本文整理汇总了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() {