Documentation ¶
Index ¶
- Constants
- func CleanErr(err error, sysErrRet, sysErrformat string, args ...interface{}) error
- func CleanErrWithCode(err error, sysErrRet, sysErrformat string, args ...interface{}) (codes.Code, error)
- func EncodePrivateKeyToPem(key crypto.Signer) (string, error)
- func EncodeToPem(typ string, data []byte) string
- func GetErrCode(err error) codes.Code
- func NewPrivateKey(ecdsaCurve string, rsaBits int) (crypto.Signer, error)
- func NextRangeFromKey(key string) string
- func RangeEndKey(key string) string
- func ReadPEM(path string) (*pem.Block, error)
- func ReadPEMCertificate(path string) (*x509.Certificate, error)
- func WriteCert(path string, perm os.FileMode, derBytes []byte) error
- func WriteFile(path string, perm os.FileMode, data []byte) error
- func WritePem(path string, perm os.FileMode, typ string, data []byte) error
- func WritePrivateKey(path string, perm os.FileMode, key crypto.Signer) error
- type ETCDConfig
- type Error
Constants ¶
View Source
const ( // EcodeSystemError SYSTEM_ERROR EcodeSystemError = "SYSTEM_ERROR" // EcodeInvalidParam INVALID_PARAM EcodeInvalidParam = "INVALID_PARAM" // EcodeMissingParam MISSING_PARAM EcodeMissingParam = "MISSING_PARAM" // EcodeInvalidName INVALID_NAME EcodeInvalidName = "INVALID_NAME" // EcodeInvalidService INVALID_SERVICE EcodeInvalidService = "INVALID_SERVICE" // EcodeInvalidZone INVALID_ZONE EcodeInvalidZone = "INVALID_ZONE" // EcodeInvalidExt INVALID_EXTENSION EcodeInvalidExt = "INVALID_EXTENSION" // EcodeInvalidValue INVALID_VALUE EcodeInvalidValue = "INVALID_VALUE" // EcodeInvalidVersion INVALID_VERSION EcodeInvalidVersion = "INVALID_VERSION" // EcodeInvalidAddress INVALID_ADDRESS EcodeInvalidAddress = "INVALID_ADDRESS" // EcodeInvalidEndpoint INVALID_ENDPOINT EcodeInvalidEndpoint = "INVALID_ENDPOINT" // EcodeDamagedEndpointValue DAMAGED_ENDPOINT_VALUE EcodeDamagedEndpointValue = "DAMAGED_ENDPOINT_VALUE" // EcodeTooManyAttempts TOO_MANY_ATTEMPTS EcodeTooManyAttempts = "TOO_MANY_ATTEMPTS" // EcodeNotFound NOT_FOUND EcodeNotFound = "NOT_FOUND" // EcodeDeadlineExceeded DEADLINE_EXCEEDED EcodeDeadlineExceeded = "DEADLINE_EXCEEDED" // EcodeCanceled CANCELED EcodeCanceled = "CANCELED" // EcodeDeleted DELETED EcodeDeleted = "DELETED" // EcodeChangedServiceDesc CHANGED_SERVICE_DESC EcodeChangedServiceDesc = "CHANGED_SERVICE_DESC" // EcodeNameDuplicated NAME_DUPLICATED EcodeNameDuplicated = "NAME_DUPLICATED" // EcodeNotPermitted NOT_PERMITTED EcodeNotPermitted = "NOT_PERMITTED" // EcodeEtcdWatchFailed ETCD_WATCH_FAILED EcodeEtcdWatchFailed = "ETCD_WATCH_FAILED" )
View Source
const ( // StatusDeleted status deleted StatusDeleted = -1 // StatusOk status ok StatusOk = 0 // StatusDisabled status disabled StatusDisabled = -1 )
Variables ¶
This section is empty.
Functions ¶
func CleanErrWithCode ¶
func CleanErrWithCode(err error, sysErrRet, sysErrformat string, args ...interface{}) (codes.Code, error)
CleanErrWithCode clean err with code
func EncodePrivateKeyToPem ¶
EncodePrivateKeyToPem encode private key to pem
func NewPrivateKey ¶
NewPrivateKey new private key
func NextRangeFromKey ¶
NextRangeFromKey next range from key
func ReadPEMCertificate ¶
func ReadPEMCertificate(path string) (*x509.Certificate, error)
ReadPEMCertificate read cert from pem
Types ¶
type ETCDConfig ¶
type ETCDConfig struct { Endpoints []string `default:"[\"127.0.0.1:2379\"]"` Timeout time.Duration `default:"5s"` CACert string }
ETCDConfig etcd config
func (*ETCDConfig) NewEtcdClient ¶
func (etcd *ETCDConfig) NewEtcdClient() *clientv3.Client
NewEtcdClient new etcd client
type Error ¶
type Error struct { Code string `json:"code"` Message string `json:"message,omitempty"` Keys []string `json:"keys,omitempty"` }
Error error
func NewNotPermittedError ¶
NewNotPermittedError new not permitted error
func SystemErrorf ¶
SystemErrorf system errorf
Source Files ¶
Click to show internal directories.
Click to hide internal directories.