code.gitea.io/gitea@v1.21.7/services/auth/source/ldap/security_protocol.go (about) 1 // Copyright 2021 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package ldap 5 6 // SecurityProtocol protocol type 7 type SecurityProtocol int 8 9 // Note: new type must be added at the end of list to maintain compatibility. 10 const ( 11 SecurityProtocolUnencrypted SecurityProtocol = iota 12 SecurityProtocolLDAPS 13 SecurityProtocolStartTLS 14 ) 15 16 // String returns the name of the SecurityProtocol 17 func (s SecurityProtocol) String() string { 18 return SecurityProtocolNames[s] 19 } 20 21 // Int returns the int value of the SecurityProtocol 22 func (s SecurityProtocol) Int() int { 23 return int(s) 24 } 25 26 // SecurityProtocolNames contains the name of SecurityProtocol values. 27 var SecurityProtocolNames = map[SecurityProtocol]string{ 28 SecurityProtocolUnencrypted: "Unencrypted", 29 SecurityProtocolLDAPS: "LDAPS", 30 SecurityProtocolStartTLS: "StartTLS", 31 }