Documentation ¶
Index ¶
- Constants
- type AddDeviceResp
- type AddDeviceRespData
- type ArchiveKeyOpts
- type ArchiveKeyResp
- type ArchiveKeyRespData
- type AuthOpts
- type AuthResp
- type AuthRespData
- type AuthService
- type BackupResp
- type BackupRespData
- type BaseService
- type CipherService
- func (cs *CipherService) Decrypt(ctx context.Context, opts *DecryptOpts) (*DecryptRespData, error)
- func (cs *CipherService) Encrypt(ctx context.Context, opts *EncryptOpts) (*EncryptRespData, error)
- func (cs *CipherService) HmacCheck(ctx context.Context, opts *HmacCheckOpts) (*HmacCheckRespData, error)
- func (cs *CipherService) HmacSum(ctx context.Context, opts *HmacSumOpts) (*HmacSumRespData, error)
- func (cs *CipherService) Random(ctx context.Context, opts *RandomOpts) (*RandomRespData, error)
- func (cs *CipherService) Sign(ctx context.Context, opts *SignOpts) (*SignRespData, error)
- func (cs *CipherService) Verify(ctx context.Context, opts *VerifyOpts) (*VerifyRespData, error)
- type Client
- type ClientConfig
- type DecryptOpts
- type DecryptResp
- type DecryptRespData
- type DestroyHandleOpts
- type DestroyHandleResp
- type DestroyHandleRespData
- type DestroyKeyOpts
- type DestroyKeyResp
- type DestroyKeyRespData
- type DistributeKeysOpts
- type DistributeKeysResp
- type DistributeKeysRespData
- type EncryptOpts
- type EncryptResp
- type EncryptRespData
- type GenerateWorkingKeyOpts
- type GenerateWorkingKeyResp
- type GenerateWorkingKeyRespData
- type HmacCheckOpts
- type HmacCheckResp
- type HmacCheckRespData
- type HmacSumOpts
- type HmacSumResp
- type HmacSumRespData
- type ImportKeyOpts
- type ImportKeyResp
- type ImportKeyRespData
- type KmsService
- func (ks *KmsService) ArchiveKey(ctx context.Context, opts *ArchiveKeyOpts) (*ArchiveKeyRespData, error)
- func (ks *KmsService) Backup(ctx context.Context) (*BackupRespData, error)
- func (ks *KmsService) DestroyHandle(ctx context.Context, opts *DestroyHandleOpts) (*DestroyHandleRespData, error)
- func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
- func (ks *KmsService) DistributeKeys(ctx context.Context, opts *DistributeKeysOpts) (*DistributeKeysRespData, error)
- func (ks *KmsService) GenerateWorkingKey(ctx context.Context, opts *GenerateWorkingKeyOpts) (*GenerateWorkingKeyRespData, error)
- func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
- func (ks *KmsService) Recover(ctx context.Context) (*RecoverRespData, error)
- func (ks *KmsService) UpdateSecret(ctx context.Context, opts *UpdateSecretOpts) (*UpdateSecretRespData, error)
- type ListDevicesResp
- type ListDevicesRespData
- type ListDevicesRespDataItem
- type RandomOpts
- type RandomResp
- type RandomRespData
- type RecoverResp
- type RecoverRespData
- type RemoveDeviceResp
- type RemoveDeviceRespData
- type SignOpts
- type SignResp
- type SignRespData
- type StartDeviceResp
- type StartDeviceRespData
- type StopDeviceResp
- type StopDeviceRespData
- type UpdateSecretOpts
- type UpdateSecretResp
- type UpdateSecretRespData
- type VerifyOpts
- type VerifyResp
- type VerifyRespData
Constants ¶
View Source
const (
ContextAccessToken = "accessToken"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddDeviceResp ¶ added in v0.2.7
type AddDeviceResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *AddDeviceRespData `json:"data"` }
type AddDeviceRespData ¶ added in v0.2.7
type AddDeviceRespData struct {
ID string `json:"id"`
}
type ArchiveKeyOpts ¶ added in v0.4.0
type ArchiveKeyResp ¶ added in v0.4.0
type ArchiveKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ArchiveKeyRespData `json:"data"` }
type ArchiveKeyRespData ¶ added in v0.4.0
type ArchiveKeyRespData struct{}
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)
Token this func returns auth data, including accessToken and expires deadline
type BackupResp ¶ added in v0.4.0
type BackupResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *BackupRespData `json:"data"` }
type BackupRespData ¶ added in v0.4.0
type BackupRespData struct{}
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) HmacCheck ¶ added in v0.2.8
func (cs *CipherService) HmacCheck(ctx context.Context, opts *HmacCheckOpts) (*HmacCheckRespData, error)
func (*CipherService) HmacSum ¶ added in v0.2.8
func (cs *CipherService) HmacSum(ctx context.Context, opts *HmacSumOpts) (*HmacSumRespData, error)
func (*CipherService) Random ¶ added in v0.1.8
func (cs *CipherService) Random(ctx context.Context, opts *RandomOpts) (*RandomRespData, error)
func (*CipherService) Sign ¶ added in v0.2.8
func (cs *CipherService) Sign(ctx context.Context, opts *SignOpts) (*SignRespData, error)
func (*CipherService) Verify ¶ added in v0.2.8
func (cs *CipherService) Verify(ctx context.Context, opts *VerifyOpts) (*VerifyRespData, error)
type Client ¶ added in v0.1.9
type Client struct { Config *ClientConfig AuthApi *AuthService CipherApi *CipherService KmsApi *KmsService }
func NewAPIClient ¶
func NewAPIClient(config *ClientConfig) *Client
NewAPIClient returns a client to call apis, ClientConfig contains ServerUrl
type ClientConfig ¶ added in v0.1.9
type ClientConfig struct {
ServerUrl string
}
func NewConfiguration ¶
func NewConfiguration(url string) *ClientConfig
NewConfiguration returns a config that contains ServerUrl
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 DestroyHandleOpts ¶ added in v0.4.0
type DestroyHandleResp ¶ added in v0.4.0
type DestroyHandleResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DestroyHandleRespData `json:"data"` }
type DestroyHandleRespData ¶ added in v0.4.0
type DestroyHandleRespData struct{}
type DestroyKeyOpts ¶ added in v0.2.2
type DestroyKeyResp ¶ added in v0.2.2
type DestroyKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DestroyKeyRespData `json:"data"` }
type DestroyKeyRespData ¶ added in v0.2.2
type DestroyKeyRespData struct{}
type DistributeKeysOpts ¶ added in v0.4.0
type DistributeKeysResp ¶ added in v0.4.0
type DistributeKeysResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *DistributeKeysRespData `json:"data"` }
type DistributeKeysRespData ¶ added in v0.4.0
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 GenerateWorkingKeyOpts ¶
type GenerateWorkingKeyResp ¶ added in v0.1.8
type GenerateWorkingKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateWorkingKeyRespData `json:"data"` }
type GenerateWorkingKeyRespData ¶
type GenerateWorkingKeyRespData struct {
BgTaskId string `json:"bgTaskId"`
}
type HmacCheckOpts ¶ added in v0.2.8
type HmacCheckResp ¶ added in v0.2.8
type HmacCheckResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *HmacCheckRespData `json:"data"` }
type HmacCheckRespData ¶ added in v0.2.8
type HmacCheckRespData struct {
Result bool `json:"result"`
}
type HmacSumOpts ¶ added in v0.2.8
type HmacSumResp ¶ added in v0.2.8
type HmacSumResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *HmacSumRespData `json:"data"` }
type HmacSumRespData ¶ added in v0.2.8
type HmacSumRespData struct {
HmacSum string `json:"hmacSum"`
}
type ImportKeyOpts ¶ added in v0.2.2
type ImportKeyResp ¶ added in v0.2.2
type ImportKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKeyRespData `json:"data"` }
type ImportKeyRespData ¶ added in v0.2.2
type ImportKeyRespData struct {
Handle string `json:"handle"`
}
type KmsService ¶ added in v0.1.8
type KmsService struct {
Base *BaseService
}
func NewKmsService ¶ added in v0.1.8
func NewKmsService() *KmsService
func (*KmsService) ArchiveKey ¶ added in v0.4.0
func (ks *KmsService) ArchiveKey(ctx context.Context, opts *ArchiveKeyOpts) (*ArchiveKeyRespData, error)
func (*KmsService) Backup ¶ added in v0.4.0
func (ks *KmsService) Backup(ctx context.Context) (*BackupRespData, error)
func (*KmsService) DestroyHandle ¶ added in v0.4.0
func (ks *KmsService) DestroyHandle(ctx context.Context, opts *DestroyHandleOpts) (*DestroyHandleRespData, error)
func (*KmsService) DestroyKey ¶ added in v0.2.2
func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
func (*KmsService) DistributeKeys ¶ added in v0.4.0
func (ks *KmsService) DistributeKeys(ctx context.Context, opts *DistributeKeysOpts) (*DistributeKeysRespData, error)
func (*KmsService) GenerateWorkingKey ¶ added in v0.1.8
func (ks *KmsService) GenerateWorkingKey(ctx context.Context, opts *GenerateWorkingKeyOpts) (*GenerateWorkingKeyRespData, error)
func (*KmsService) ImportKey ¶ added in v0.2.2
func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
func (*KmsService) Recover ¶ added in v0.4.0
func (ks *KmsService) Recover(ctx context.Context) (*RecoverRespData, error)
func (*KmsService) UpdateSecret ¶ added in v0.4.0
func (ks *KmsService) UpdateSecret(ctx context.Context, opts *UpdateSecretOpts) (*UpdateSecretRespData, error)
type ListDevicesResp ¶ added in v0.2.7
type ListDevicesResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ListDevicesRespData `json:"data"` }
type ListDevicesRespData ¶ added in v0.2.7
type ListDevicesRespData struct {
Lists []ListDevicesRespDataItem `json:"lists"`
}
type ListDevicesRespDataItem ¶ added in v0.2.7
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"`
}
type RecoverResp ¶ added in v0.4.0
type RecoverResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *RecoverRespData `json:"data"` }
type RecoverRespData ¶ added in v0.4.0
type RecoverRespData struct{}
type RemoveDeviceResp ¶ added in v0.2.7
type RemoveDeviceResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *RemoveDeviceRespData `json:"data"` }
type RemoveDeviceRespData ¶ added in v0.2.7
type RemoveDeviceRespData struct {
Ret bool `json:"ret"`
}
type SignResp ¶ added in v0.2.8
type SignResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *SignRespData `json:"data"` }
type SignRespData ¶ added in v0.2.8
type SignRespData struct {
Sig string `json:"sig"`
}
type StartDeviceResp ¶ added in v0.2.7
type StartDeviceResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *StartDeviceRespData `json:"data"` }
type StartDeviceRespData ¶ added in v0.2.7
type StartDeviceRespData struct {
Ret bool `json:"ret"`
}
type StopDeviceResp ¶ added in v0.2.7
type StopDeviceResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *StopDeviceRespData `json:"data"` }
type StopDeviceRespData ¶ added in v0.2.7
type StopDeviceRespData struct {
Ret bool `json:"ret"`
}
type UpdateSecretOpts ¶ added in v0.4.0
type UpdateSecretResp ¶ added in v0.4.0
type UpdateSecretResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *UpdateSecretRespData `json:"data"` }
type UpdateSecretRespData ¶ added in v0.4.0
type UpdateSecretRespData struct{}
type VerifyOpts ¶ added in v0.2.8
type VerifyResp ¶ added in v0.2.8
type VerifyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *VerifyRespData `json:"data"` }
type VerifyRespData ¶ added in v0.2.8
type VerifyRespData struct {
Verify bool `json:"verify"`
}
Click to show internal directories.
Click to hide internal directories.