Documentation ¶
Index ¶
- Constants
- type AuthOpts
- type AuthResp
- type AuthRespData
- type AuthService
- type BaseService
- type CipherService
- type Client
- type ClientConfig
- type DecryptOpts
- type DecryptResp
- type DecryptRespData
- type EncryptOpts
- type EncryptResp
- type EncryptRespData
- type GenerateKeyPairOpts
- type GenerateKeyPairResp
- type GenerateKeyPairRespData
- type GenerateKeyPairWithKEKOpts
- type GenerateKeyPairWithKEKResp
- type GenerateKeyPairWithKEKRespData
- type GenerateWorkingKeyOpts
- type GenerateWorkingKeyResp
- type GenerateWorkingKeyRespData
- type ImportKeyPairWithKEKOpts
- type ImportKeyPairWithKEKResp
- type ImportKeyPairWithKEKRespData
- type KmsExtService
- type KmsService
- type RandomOpts
- type RandomResp
- type RandomRespData
Constants ¶
View Source
const (
ContextAccessToken = "accessToken"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResp ¶ added in v0.1.9
type AuthResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *AuthRespData `json:"data"` }
type AuthRespData ¶
type AuthService ¶ added in v0.1.8
type AuthService struct {
Base *BaseService
}
func NewAuthService ¶ added in v0.1.8
func NewAuthService() *AuthService
func (*AuthService) Token ¶ added in v0.1.8
func (as *AuthService) Token(ctx context.Context, authOpts *AuthOpts) (*AuthRespData, error)
type BaseService ¶ added in v0.1.8
type BaseService struct {
C *resty.Client
}
var BaseSvc *BaseService
type CipherService ¶ added in v0.1.8
type CipherService struct {
Base *BaseService
}
func NewCipherService ¶ added in v0.1.8
func NewCipherService() *CipherService
func (*CipherService) Decrypt ¶ added in v0.1.8
func (cs *CipherService) Decrypt(ctx context.Context, opts *DecryptOpts) (*DecryptRespData, error)
func (*CipherService) Encrypt ¶ added in v0.1.8
func (cs *CipherService) Encrypt(ctx context.Context, opts *EncryptOpts) (*EncryptRespData, error)
func (*CipherService) Random ¶ added in v0.1.8
func (cs *CipherService) Random(ctx context.Context, opts *RandomOpts) (*RandomRespData, error)
type Client ¶ added in v0.1.9
type Client struct { Config *ClientConfig AuthApi *AuthService CipherApi *CipherService KmsApi *KmsService KmsExtApi *KmsExtService }
func NewAPIClient ¶
func NewAPIClient(config *ClientConfig) *Client
type ClientConfig ¶ added in v0.1.9
type ClientConfig struct {
ServerUrl string
}
func NewConfiguration ¶
func NewConfiguration(url string) *ClientConfig
type DecryptOpts ¶ added in v0.1.3
type DecryptResp ¶ added in v0.1.8
type DecryptResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DecryptRespData `json:"data"` }
type DecryptRespData ¶ added in v0.1.3
type DecryptRespData struct {
Data string `json:"data"`
}
type EncryptOpts ¶ added in v0.1.3
type EncryptResp ¶ added in v0.1.8
type EncryptResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *EncryptRespData `json:"data"` }
type EncryptRespData ¶ added in v0.1.3
type EncryptRespData struct {
EncData string `json:"enc_data"`
}
type GenerateKeyPairOpts ¶
type GenerateKeyPairOpts struct { }
type GenerateKeyPairResp ¶ added in v0.1.8
type GenerateKeyPairResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateKeyPairRespData `json:"data"` }
type GenerateKeyPairRespData ¶
type GenerateKeyPairWithKEKOpts ¶ added in v0.1.3
type GenerateKeyPairWithKEKResp ¶ added in v0.1.8
type GenerateKeyPairWithKEKResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateKeyPairWithKEKRespData `json:"data"` }
type GenerateKeyPairWithKEKRespData ¶ added in v0.1.3
type GenerateWorkingKeyOpts ¶
type GenerateWorkingKeyOpts struct { }
type GenerateWorkingKeyResp ¶ added in v0.1.8
type GenerateWorkingKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateWorkingKeyRespData `json:"data"` }
type ImportKeyPairWithKEKOpts ¶ added in v0.1.3
type ImportKeyPairWithKEKResp ¶ added in v0.1.8
type ImportKeyPairWithKEKResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKeyPairWithKEKRespData `json:"data"` }
type ImportKeyPairWithKEKRespData ¶ added in v0.1.3
type ImportKeyPairWithKEKRespData struct {
ID int `json:"id"`
}
type KmsExtService ¶ added in v0.2.0
type KmsExtService struct {
Base *BaseService
}
func NewKmsExtService ¶ added in v0.2.0
func NewKmsExtService() *KmsExtService
func (*KmsExtService) GenerateKeyPairWithKEK ¶ added in v0.2.0
func (kes *KmsExtService) GenerateKeyPairWithKEK(ctx context.Context, opts *GenerateKeyPairWithKEKOpts) (*GenerateKeyPairWithKEKRespData, error)
func (*KmsExtService) ImportKeyPairWithKEK ¶ added in v0.2.0
func (kes *KmsExtService) ImportKeyPairWithKEK(ctx context.Context, opts *ImportKeyPairWithKEKOpts) (*ImportKeyPairWithKEKRespData, error)
type KmsService ¶ added in v0.1.8
type KmsService struct {
Base *BaseService
}
func NewKmsService ¶ added in v0.1.8
func NewKmsService() *KmsService
func (*KmsService) GenerateKeyPair ¶ added in v0.1.8
func (ks *KmsService) GenerateKeyPair(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)
func (*KmsService) GenerateWorkingKey ¶ added in v0.1.8
func (ks *KmsService) GenerateWorkingKey(ctx context.Context, opts *GenerateWorkingKeyOpts) (*GenerateWorkingKeyRespData, error)
type RandomOpts ¶ added in v0.1.5
type RandomResp ¶ added in v0.1.8
type RandomResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *RandomRespData `json:"data"` }
type RandomRespData ¶ added in v0.1.5
type RandomRespData struct {
Data string `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.