secloud

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 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 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 ArchiveKeyOpts struct {
	KeyId         optional.String `json:"keyId"`
	ArchiveReason optional.String `json:"archiveReason"`
}

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 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 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 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 DestroyHandleOpts added in v0.4.0

type DestroyHandleOpts struct {
	Handle optional.String `json:"handle"`
}

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 DestroyKeyOpts struct {
	KeyId optional.String `json:"keyId"`
}

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 DistributeKeysOpts struct {
	GenerateType optional.String `json:"generateType"`
	InvokeCount  optional.Int    `json:"invokeCount"`
}

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 DistributeKeysRespData struct {
	KeyId  string `json:"keyId"`
	EncKey string `json:"encKey"`
}

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 GenerateWorkingKeyOpts

type GenerateWorkingKeyOpts struct {
	GenerateAlgo optional.String `json:"generateAlgo"`
	GenerateType optional.String `json:"generateType"`
	KeyType      optional.String `json:"keyType"`
	EpkName      optional.String `json:"epkName"`
	Count        optional.Int    `json:"count"`
}

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 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 ImportKeyOpts added in v0.2.2

type ImportKeyOpts struct {
	Mode   optional.String `json:"mode"`
	Secret optional.String `json:"secret"`
	KeyId  optional.String `json:"keyId"`
}

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 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 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 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 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 UpdateSecretOpts struct {
	KeyId   optional.String `json:"keyId"`
	KeyType optional.String `json:"keyType"`
	EpkName optional.String `json:"epkName"`
}

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 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