Documentation ¶
Index ¶
- Constants
- type AddDeviceOpts
- type AddDeviceResp
- type AddDeviceRespData
- type AuthOpts
- type AuthResp
- type AuthRespData
- type AuthService
- type AutoTestService
- 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 DestroyKeyOpts
- type DestroyKeyResp
- type DestroyKeyRespData
- type EncryptOpts
- type EncryptResp
- type EncryptRespData
- type ExportPublicKeyOpts
- type ExportPublicKeyResp
- type ExportPublicKeyRespData
- type GenerateKeyOpts
- type GenerateKeyPairOpts
- type GenerateKeyPairResp
- type GenerateKeyPairRespData
- type GenerateKeyResp
- type GenerateKeyRespData
- type HmacCheckOpts
- type HmacCheckResp
- type HmacCheckRespData
- type HmacSumOpts
- type HmacSumResp
- type HmacSumRespData
- type ImportKEKOpts
- type ImportKEKResp
- type ImportKEKRespData
- type ImportKeyOpts
- type ImportKeyPairOpts
- type ImportKeyPairResp
- type ImportKeyPairRespData
- type ImportKeyResp
- type ImportKeyRespData
- type KmsService
- func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
- func (ks *KmsService) ExportPublicKey(ctx context.Context, opts *ExportPublicKeyOpts) (*ExportPublicKeyRespData, error)
- func (ks *KmsService) GenerateKey(ctx context.Context, opts *GenerateKeyOpts) (*GenerateKeyRespData, error)
- func (ks *KmsService) GenerateKeyPair(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)
- func (ks *KmsService) ImportKEK(ctx context.Context, opts *ImportKEKOpts) (*ImportKEKRespData, error)
- func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
- func (ks *KmsService) ImportKeyPair(ctx context.Context, opts *ImportKeyPairOpts) (*ImportKeyPairRespData, error)
- type ListDevicesOpts
- type ListDevicesResp
- type ListDevicesRespData
- type ListDevicesRespDataItem
- type RandomOpts
- type RandomResp
- type RandomRespData
- type RemoveDeviceOpts
- type RemoveDeviceResp
- type RemoveDeviceRespData
- type SdmService
- func (ss *SdmService) AddDevice(ctx context.Context, opts *AddDeviceOpts) (*AddDeviceRespData, error)
- func (ss *SdmService) ListDevices(ctx context.Context, opts *ListDevicesOpts) (*ListDevicesRespData, error)
- func (ss *SdmService) RemoveDevice(ctx context.Context, opts *RemoveDeviceOpts) (*RemoveDeviceRespData, error)
- func (ss *SdmService) StartDevice(ctx context.Context, opts *StartDeviceOpts) (*StartDeviceRespData, error)
- func (ss *SdmService) StopDevice(ctx context.Context, opts *StopDeviceOpts) (*StopDeviceRespData, error)
- type SignOpts
- type SignResp
- type SignRespData
- type StartAutoTestOpts
- type StartAutoTestResp
- type StartAutoTestRespData
- type StartDeviceOpts
- type StartDeviceResp
- type StartDeviceRespData
- type StopDeviceOpts
- type StopDeviceResp
- type StopDeviceRespData
- type VerifyOpts
- type VerifyResp
- type VerifyRespData
Constants ¶
View Source
const (
ContextAccessToken = "accessToken"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddDeviceOpts ¶ added in v0.2.7
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 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 AutoTestService ¶ added in v0.2.8
type AutoTestService struct {
Base *BaseService
}
func NewAutoTestService ¶ added in v0.2.8
func NewAutoTestService() *AutoTestService
func (*AutoTestService) StartAutoTest ¶ added in v0.2.8
func (ats *AutoTestService) StartAutoTest(ctx context.Context, opts *StartAutoTestOpts) (*StartAutoTestRespData, 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) 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 SdmApi *SdmService AutoTestApi *AutoTestService }
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 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 {
Result int `json:"result"`
}
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 ExportPublicKeyOpts ¶ added in v0.2.2
type ExportPublicKeyResp ¶ added in v0.2.2
type ExportPublicKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ExportPublicKeyRespData `json:"data"` }
type ExportPublicKeyRespData ¶ added in v0.2.2
type ExportPublicKeyRespData struct {
Pkey string `json:"pkey"`
}
type GenerateKeyOpts ¶ added in v0.2.2
type GenerateKeyOpts struct { GenKeyType optional.String `json:"genKeyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` KeyType optional.String `json:"keyType"` Mode optional.String `json:"mode"` PoolId optional.Int64 `json:"poolId"` PublicKey optional.String `json:"publicKey"` }
type GenerateKeyPairOpts ¶
type GenerateKeyPairOpts struct { ExportType optional.String `json:"exportType"` GenKeyType optional.String `json:"genKeyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` KeyType optional.String `json:"keyType"` Mode optional.String `json:"mode"` PoolId optional.Int64 `json:"poolId"` PublicKey optional.String `json:"publicKey"` }
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 GenerateKeyResp ¶ added in v0.2.2
type GenerateKeyResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *GenerateKeyRespData `json:"data"` }
type GenerateKeyRespData ¶ added in v0.2.2
type GenerateKeyRespData struct {
EncKey string `json:"enc_key"`
}
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 ImportKEKOpts ¶ added in v0.2.3
type ImportKEKOpts struct { EncKey optional.String `json:"encKey"` PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` KeyCode optional.String `json:"keyCode"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` TargetIndex optional.Int `json:"targetIndex"` }
type ImportKEKResp ¶ added in v0.2.3
type ImportKEKResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKEKRespData `json:"data"` }
type ImportKEKRespData ¶ added in v0.2.3
type ImportKEKRespData struct {
Index int `json:"index"`
}
type ImportKeyOpts ¶ added in v0.2.2
type ImportKeyOpts struct { EncKey optional.String `json:"encKey"` PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` KeyCode optional.String `json:"keyCode"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` }
type ImportKeyPairOpts ¶ added in v0.2.2
type ImportKeyPairOpts struct { PoolId optional.Int64 `json:"poolId"` Mode optional.String `json:"mode"` KeyType optional.String `json:"keyType"` IpxIndex optional.Int `json:"ipxIndex"` KekIndex optional.Int `json:"kekIndex"` TargetType optional.String `json:"targetType"` TargetIndex optional.Int `json:"targetIndex"` SignPkey optional.String `json:"signPkey"` SignSkey optional.String `json:"signSkey"` EncPkey optional.String `json:"encPkey"` EncSkey optional.String `json:"encSkey"` }
type ImportKeyPairResp ¶ added in v0.2.2
type ImportKeyPairResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *ImportKeyPairRespData `json:"data"` }
type ImportKeyPairRespData ¶ added in v0.2.2
type ImportKeyPairRespData struct {
ID int `json:"id"`
}
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) DestroyKey ¶ added in v0.2.2
func (ks *KmsService) DestroyKey(ctx context.Context, opts *DestroyKeyOpts) (*DestroyKeyRespData, error)
func (*KmsService) ExportPublicKey ¶ added in v0.2.2
func (ks *KmsService) ExportPublicKey(ctx context.Context, opts *ExportPublicKeyOpts) (*ExportPublicKeyRespData, error)
func (*KmsService) GenerateKey ¶ added in v0.2.2
func (ks *KmsService) GenerateKey(ctx context.Context, opts *GenerateKeyOpts) (*GenerateKeyRespData, error)
func (*KmsService) GenerateKeyPair ¶ added in v0.1.8
func (ks *KmsService) GenerateKeyPair(ctx context.Context, opts *GenerateKeyPairOpts) (*GenerateKeyPairRespData, error)
func (*KmsService) ImportKEK ¶ added in v0.2.3
func (ks *KmsService) ImportKEK(ctx context.Context, opts *ImportKEKOpts) (*ImportKEKRespData, error)
func (*KmsService) ImportKey ¶ added in v0.2.2
func (ks *KmsService) ImportKey(ctx context.Context, opts *ImportKeyOpts) (*ImportKeyRespData, error)
func (*KmsService) ImportKeyPair ¶ added in v0.2.2
func (ks *KmsService) ImportKeyPair(ctx context.Context, opts *ImportKeyPairOpts) (*ImportKeyPairRespData, error)
type ListDevicesOpts ¶ added in v0.2.7
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 RemoveDeviceOpts ¶ added in v0.2.7
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 SdmService ¶ added in v0.2.7
type SdmService struct {
Base *BaseService
}
func NewSdmService ¶ added in v0.2.7
func NewSdmService() *SdmService
func (*SdmService) AddDevice ¶ added in v0.2.7
func (ss *SdmService) AddDevice(ctx context.Context, opts *AddDeviceOpts) (*AddDeviceRespData, error)
func (*SdmService) ListDevices ¶ added in v0.2.7
func (ss *SdmService) ListDevices(ctx context.Context, opts *ListDevicesOpts) (*ListDevicesRespData, error)
func (*SdmService) RemoveDevice ¶ added in v0.2.7
func (ss *SdmService) RemoveDevice(ctx context.Context, opts *RemoveDeviceOpts) (*RemoveDeviceRespData, error)
func (*SdmService) StartDevice ¶ added in v0.2.7
func (ss *SdmService) StartDevice(ctx context.Context, opts *StartDeviceOpts) (*StartDeviceRespData, error)
func (*SdmService) StopDevice ¶ added in v0.2.7
func (ss *SdmService) StopDevice(ctx context.Context, opts *StopDeviceOpts) (*StopDeviceRespData, error)
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 StartAutoTestOpts ¶ added in v0.2.8
type StartAutoTestResp ¶ added in v0.2.8
type StartAutoTestResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *StartAutoTestRespData `json:"data"` }
type StartAutoTestRespData ¶ added in v0.2.8
type StartDeviceOpts ¶ added in v0.2.7
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 StopDeviceOpts ¶ added in v0.2.7
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 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.