secloud

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 AddDeviceOpts struct {
	Name optional.String
	Port optional.Int
}

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 AuthOpts

type AuthOpts struct {
	ClientId     optional.String
	ClientSecret optional.String
}

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 AuthRespData struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

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 DecryptOpts struct {
	KeyId   optional.String
	EncData optional.String
}

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 DestroyKeyOpts struct {
	Handle optional.String `json:"handle"`
	PoolId optional.Int64  `json:"poolId"`
}

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 EncryptOpts struct {
	KeyId optional.String
	Data  optional.String
}

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 ExportPublicKeyOpts struct {
	IpxIndex optional.Int    `json:"ipxIndex"`
	KeyType  optional.String `json:"keyType"`
	Mode     optional.String `json:"mode"`
	PoolId   optional.Int64  `json:"poolId"`
}

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 GenerateKeyPairRespData struct {
	Pkey string `json:"pkey"`
	Skey string `json:"skey"`
}

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 HmacCheckOpts struct {
	KeyId   optional.String
	Data    optional.String
	HmacSum optional.String
}

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 HmacSumOpts struct {
	KeyId optional.String
	Data  optional.String
}

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 ListDevicesOpts struct {
	Name optional.String
}

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 ListDevicesRespDataItem struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Port   string `json:"port"`
	State  string `json:"state"`
	Status string `json:"status"`
}

type RandomOpts added in v0.1.5

type RandomOpts struct {
	Len optional.Int
}

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 RemoveDeviceOpts struct {
	Name optional.String
	ID   optional.String
}

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 SignOpts added in v0.2.8

type SignOpts struct {
	RootKeyId optional.String
	Data      optional.String
}

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 StartAutoTestOpts struct {
	GoHost      optional.String `json:"goHost"`
	GatewayHost optional.String `json:"gatewayHost"`
}

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 StartAutoTestRespData struct {
	Uuid  string `json:"uuid"`
	Total int    `json:"total"`
}

type StartDeviceOpts added in v0.2.7

type StartDeviceOpts struct {
	Name optional.String
	ID   optional.String
}

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 StopDeviceOpts struct {
	Name optional.String
	ID   optional.String
}

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 VerifyOpts struct {
	Mode      optional.String
	RootKeyId optional.Int64
	Data      optional.String
	Sig       optional.String
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL