Documentation ¶
Index ¶
- Variables
- type CreateSecretRequest
- type CrendentialType
- type DeleteSecretRequest
- type DescribeSecretRequest
- type QuerySecretRequest
- type Secret
- func (s *Secret) AllowRegionString() string
- func (s *Secret) DecryptAPISecret(key string) error
- func (s *Secret) Desense()
- func (s *Secret) EncryptAPISecret(key string) error
- func (s *Secret) IsAllowRegion(region string) bool
- func (s *Secret) LoadAllowRegionFromString(regions string)
- func (s *Secret) ShortDesc() string
- type SecretSet
- type Service
- type Type
- type Vendor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CrendentialType_name = map[int32]string{ 0: "CRENDENTIAL_API_KEY", 1: "CRENDENTIAL_PASSWORD", } CrendentialType_value = map[string]int32{ "CRENDENTIAL_API_KEY": 0, "CRENDENTIAL_PASSWORD": 1, } )
Enum value maps for Type.
View Source
var ( Type_name = map[int32]string{ 0: "Unsuport", 1: "HOST", 2: "RDS", } Type_value = map[string]int32{ "Unsuport": 0, "HOST": 1, "RDS": 2, } )
Enum value maps for Type.
View Source
var ( Vendor_name = map[int32]string{ 0: "VENDOR_ALIYUN", 1: "VENDOR_TENCENT", 2: "VENDOR_HUAWEI", 3: "VENDOR_VSPHERE", } Vendor_value = map[string]int32{ "VENDOR_ALIYUN": 0, "VENDOR_TENCENT": 1, "VENDOR_HUAWEI": 2, "VENDOR_VSPHERE": 3, } )
Enum value maps for Type.
Functions ¶
This section is empty.
Types ¶
type CreateSecretRequest ¶
type CreateSecretRequest struct { Description string `json:"description" validate:"required,lte=100"` // 描述 Vendor Vendor `json:"vendor"` // 厂商 AllowRegions []string `json:"allow_regions"` // 允许同步的区域 CrendentialType CrendentialType `json:"crendential_type"` // 凭证类型 Address string `json:"address"` // 服务地址, 云商不用填写 APIKey string `json:"api_key" validate:"required,lte=100"` // key APISecret string `json:"api_secret" validate:"required,lte=100"` // secrete RequestRate int `json:"request_rate"` // 请求速率限制, 默认1秒5个 }
func NewCreateSecretRequest ¶
func NewCreateSecretRequest() *CreateSecretRequest
func (*CreateSecretRequest) Validate ¶
func (req *CreateSecretRequest) Validate() error
type CrendentialType ¶
type CrendentialType int
const ( CrendentialAPIKey CrendentialType = iota CrendentialPassword )
func ParseCrendentialTypeFromString ¶
func ParseCrendentialTypeFromString(str string) (CrendentialType, error)
ParseCrendentialTypeFromString Parse Type from string
func (CrendentialType) Equal ¶
func (t CrendentialType) Equal(target CrendentialType) bool
Equal type compare
func (CrendentialType) IsIn ¶
func (t CrendentialType) IsIn(targets ...CrendentialType) bool
IsIn todo
func (CrendentialType) MarshalJSON ¶
func (t CrendentialType) MarshalJSON() ([]byte, error)
MarshalJSON todo
func (CrendentialType) String ¶
func (t CrendentialType) String() string
func (*CrendentialType) UnmarshalJSON ¶
func (t *CrendentialType) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type DeleteSecretRequest ¶
type DeleteSecretRequest struct {
Id string
}
func NewDeleteSecretRequestWithID ¶
func NewDeleteSecretRequestWithID(id string) *DeleteSecretRequest
type DescribeSecretRequest ¶
type DescribeSecretRequest struct {
Id string
}
func NewDescribeSecretRequest ¶
func NewDescribeSecretRequest(id string) *DescribeSecretRequest
type QuerySecretRequest ¶
type QuerySecretRequest struct { PageSize uint64 `json:"page_size,omitempty"` PageNumber uint64 `json:"page_number,omitempty"` Keywords string `json:"keywords"` }
func NewQuerySecretRequest ¶
func NewQuerySecretRequest() *QuerySecretRequest
func NewQuerySecretRequestFromHTTP ¶
func NewQuerySecretRequestFromHTTP(r *http.Request) *QuerySecretRequest
func (*QuerySecretRequest) OffSet ¶
func (req *QuerySecretRequest) OffSet() int64
type Secret ¶
type Secret struct { Id string `json:"id"` // 全局唯一Id CreateAt int64 `json:"create_at"` // 创建时间 *CreateSecretRequest }
func NewDefaultSecret ¶
func NewDefaultSecret() *Secret
func NewSecret ¶
func NewSecret(req *CreateSecretRequest) (*Secret, error)
func (*Secret) AllowRegionString ¶
func (*Secret) DecryptAPISecret ¶
func (*Secret) EncryptAPISecret ¶
func (*Secret) IsAllowRegion ¶
func (*Secret) LoadAllowRegionFromString ¶
type SecretSet ¶
func NewSecretSet ¶
func NewSecretSet() *SecretSet
type Service ¶
type Service interface { CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error) }
type Vendor ¶
type Vendor int
func ParseVendorFromString ¶
ParseVendorFromString Parse Type from string
Click to show internal directories.
Click to hide internal directories.