本文整理匯總了Golang中confab.Controller.EncryptKeys方法的典型用法代碼示例。如果您正苦於以下問題:Golang Controller.EncryptKeys方法的具體用法?Golang Controller.EncryptKeys怎麽用?Golang Controller.EncryptKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類confab.Controller
的用法示例。
在下文中一共展示了Controller.EncryptKeys方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
Context("when the server does not have ssl enabled", func() {
BeforeEach(func() {
controller.SSLDisabled = true
})
It("does not set keys", func() {
Expect(controller.ConfigureServer()).To(Succeed())
Expect(agentClient.SetKeysCall.Receives.Keys).To(BeNil())
})
})
Context("when ssl is enabled but no keys are provided", func() {
BeforeEach(func() {
controller.EncryptKeys = []string{}
})
It("returns an error", func() {
Expect(controller.ConfigureServer()).To(MatchError("encrypt keys cannot be empty if ssl is enabled"))
Expect(agentClient.SetKeysCall.Receives.Keys).To(BeNil())
})
})
})
Context("when it is the last node in the cluster", func() {
BeforeEach(func() {
agentClient.IsLastNodeCall.Returns.IsLastNode = true
})
It("checks that it is synced", func() {