Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type CreateSecretRequest
- func (req *CreateSecretRequest) AllowRegionString() string
- func (s *CreateSecretRequest) DecryptAPISecret(key string) error
- func (*CreateSecretRequest) Descriptor() ([]byte, []int)deprecated
- func (s *CreateSecretRequest) Desense()
- func (s *CreateSecretRequest) EncryptAPISecret(key string) error
- func (x *CreateSecretRequest) GetAddress() string
- func (x *CreateSecretRequest) GetAllowRegions() []string
- func (x *CreateSecretRequest) GetApiKey() string
- func (x *CreateSecretRequest) GetApiSecret() string
- func (x *CreateSecretRequest) GetCrendentialType() Type
- func (x *CreateSecretRequest) GetDescription() string
- func (x *CreateSecretRequest) GetRequestRate() int32
- func (x *CreateSecretRequest) GetVendor() resource.Vendor
- func (req *CreateSecretRequest) LoadAllowRegionFromString(region string)
- func (*CreateSecretRequest) ProtoMessage()
- func (x *CreateSecretRequest) ProtoReflect() protoreflect.Message
- func (x *CreateSecretRequest) Reset()
- func (x *CreateSecretRequest) String() string
- func (req *CreateSecretRequest) Validate() error
- type DeleteSecretRequest
- func (*DeleteSecretRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteSecretRequest) GetId() string
- func (*DeleteSecretRequest) ProtoMessage()
- func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteSecretRequest) Reset()
- func (x *DeleteSecretRequest) String() string
- type DescribeSecretRequest
- func (*DescribeSecretRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeSecretRequest) GetId() string
- func (*DescribeSecretRequest) ProtoMessage()
- func (x *DescribeSecretRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeSecretRequest) Reset()
- func (x *DescribeSecretRequest) String() string
- type QuerySecretRequest
- func (*QuerySecretRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QuerySecretRequest) GetDomain() string
- func (x *QuerySecretRequest) GetKeywords() string
- func (x *QuerySecretRequest) GetNamespace() string
- func (x *QuerySecretRequest) GetPage() *request.PageRequest
- func (*QuerySecretRequest) ProtoMessage()
- func (x *QuerySecretRequest) ProtoReflect() protoreflect.Message
- func (x *QuerySecretRequest) Reset()
- func (x *QuerySecretRequest) String() string
- type Secret
- func (*Secret) Descriptor() ([]byte, []int)deprecated
- func (x *Secret) GetCreateAt() int64
- func (x *Secret) GetData() *CreateSecretRequest
- func (x *Secret) GetId() string
- func (*Secret) ProtoMessage()
- func (x *Secret) ProtoReflect() protoreflect.Message
- func (x *Secret) Reset()
- func (x *Secret) String() string
- type SecretSet
- func (t *SecretSet) Add(s *Secret)
- func (*SecretSet) Descriptor() ([]byte, []int)deprecated
- func (x *SecretSet) GetItems() []*Secret
- func (x *SecretSet) GetTotal() int64
- func (*SecretSet) ProtoMessage()
- func (x *SecretSet) ProtoReflect() protoreflect.Message
- func (x *SecretSet) Reset()
- func (x *SecretSet) String() string
- type ServiceClient
- type ServiceServer
- type Type
- func (Type) Descriptor() protoreflect.EnumDescriptor
- func (x Type) Enum() *Type
- func (Type) EnumDescriptor() ([]byte, []int)deprecated
- func (t Type) Equal(target Type) bool
- func (t Type) IsIn(targets ...Type) bool
- func (t Type) MarshalJSON() ([]byte, error)
- func (x Type) Number() protoreflect.EnumNumber
- func (x Type) String() string
- func (Type) Type() protoreflect.EnumType
- func (t *Type) UnmarshalJSON(b []byte) error
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
- func (UnimplementedServiceServer) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error)
- func (UnimplementedServiceServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
- func (UnimplementedServiceServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
- type UnsafeServiceServer
Constants ¶
const (
AppName = "secret"
)
Variables ¶
var ( Type_name = map[int32]string{ 0: "API_KEY", 1: "PASSWORD", } Type_value = map[string]int32{ "API_KEY": 0, "PASSWORD": 1, } )
Enum value maps for Type.
var File_apps_secret_pb_secret_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cmdb.secret.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateSecret", Handler: _Service_CreateSecret_Handler, }, { MethodName: "QuerySecret", Handler: _Service_QuerySecret_Handler, }, { MethodName: "DescribeSecret", Handler: _Service_DescribeSecret_Handler, }, { MethodName: "DeleteSecret", Handler: _Service_DeleteSecret_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/secret/pb/secret.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type CreateSecretRequest ¶
type CreateSecretRequest struct { // 描述 // @gotags: json:"description" validate:"required,lte=100" Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // 厂商 // @gotags: json:"vendor" Vendor resource.Vendor `protobuf:"varint,2,opt,name=vendor,proto3,enum=cmdb.resource.Vendor" json:"vendor,omitempty"` // 允许同步的区域 // @gotags: json:"allow_regions" AllowRegions []string `protobuf:"bytes,3,rep,name=allow_regions,json=allowRegions,proto3" json:"allow_regions,omitempty"` // 凭证类型 // @gotags: json:"crendential_type" CrendentialType Type `` /* 129-byte string literal not displayed */ // 服务地址, 云商不用填写 // @gotags: json:"address" Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` // key // @gotags: json:"api_key" validate:"required,lte=100" ApiKey string `protobuf:"bytes,6,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` // secrete // @gotags: json:"api_secret" validate:"required,lte=100" ApiSecret string `protobuf:"bytes,7,opt,name=api_secret,json=apiSecret,proto3" json:"api_secret,omitempty"` // 请求速率限制, 默认1秒5个 这个参数没用 // @gotags: json:"request_rate" RequestRate int32 `protobuf:"varint,8,opt,name=request_rate,json=requestRate,proto3" json:"request_rate,omitempty"` // contains filtered or unexported fields }
func NewCreateSecretRequest ¶
func NewCreateSecretRequest() *CreateSecretRequest
func (*CreateSecretRequest) AllowRegionString ¶
func (req *CreateSecretRequest) AllowRegionString() string
func (*CreateSecretRequest) DecryptAPISecret ¶
func (s *CreateSecretRequest) DecryptAPISecret(key string) error
func (*CreateSecretRequest) Descriptor
deprecated
func (*CreateSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateSecretRequest.ProtoReflect.Descriptor instead.
func (*CreateSecretRequest) EncryptAPISecret ¶
func (s *CreateSecretRequest) EncryptAPISecret(key string) error
func (*CreateSecretRequest) GetAddress ¶
func (x *CreateSecretRequest) GetAddress() string
func (*CreateSecretRequest) GetAllowRegions ¶
func (x *CreateSecretRequest) GetAllowRegions() []string
func (*CreateSecretRequest) GetApiKey ¶
func (x *CreateSecretRequest) GetApiKey() string
func (*CreateSecretRequest) GetApiSecret ¶
func (x *CreateSecretRequest) GetApiSecret() string
func (*CreateSecretRequest) GetCrendentialType ¶
func (x *CreateSecretRequest) GetCrendentialType() Type
func (*CreateSecretRequest) GetDescription ¶
func (x *CreateSecretRequest) GetDescription() string
func (*CreateSecretRequest) GetRequestRate ¶
func (x *CreateSecretRequest) GetRequestRate() int32
func (*CreateSecretRequest) GetVendor ¶
func (x *CreateSecretRequest) GetVendor() resource.Vendor
func (*CreateSecretRequest) LoadAllowRegionFromString ¶
func (req *CreateSecretRequest) LoadAllowRegionFromString(region string)
func (*CreateSecretRequest) ProtoMessage ¶
func (*CreateSecretRequest) ProtoMessage()
func (*CreateSecretRequest) ProtoReflect ¶
func (x *CreateSecretRequest) ProtoReflect() protoreflect.Message
func (*CreateSecretRequest) Reset ¶
func (x *CreateSecretRequest) Reset()
func (*CreateSecretRequest) String ¶
func (x *CreateSecretRequest) String() string
func (*CreateSecretRequest) Validate ¶
func (req *CreateSecretRequest) Validate() error
type DeleteSecretRequest ¶
type DeleteSecretRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func NewDeleteSecretRequestWithID ¶
func NewDeleteSecretRequestWithID(id string) *DeleteSecretRequest
func (*DeleteSecretRequest) Descriptor
deprecated
func (*DeleteSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteSecretRequest.ProtoReflect.Descriptor instead.
func (*DeleteSecretRequest) GetId ¶
func (x *DeleteSecretRequest) GetId() string
func (*DeleteSecretRequest) ProtoMessage ¶
func (*DeleteSecretRequest) ProtoMessage()
func (*DeleteSecretRequest) ProtoReflect ¶
func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message
func (*DeleteSecretRequest) Reset ¶
func (x *DeleteSecretRequest) Reset()
func (*DeleteSecretRequest) String ¶
func (x *DeleteSecretRequest) String() string
type DescribeSecretRequest ¶
type DescribeSecretRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func NewDescribeSecretRequest ¶
func NewDescribeSecretRequest(id string) *DescribeSecretRequest
func (*DescribeSecretRequest) Descriptor
deprecated
func (*DescribeSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeSecretRequest.ProtoReflect.Descriptor instead.
func (*DescribeSecretRequest) GetId ¶
func (x *DescribeSecretRequest) GetId() string
func (*DescribeSecretRequest) ProtoMessage ¶
func (*DescribeSecretRequest) ProtoMessage()
func (*DescribeSecretRequest) ProtoReflect ¶
func (x *DescribeSecretRequest) ProtoReflect() protoreflect.Message
func (*DescribeSecretRequest) Reset ¶
func (x *DescribeSecretRequest) Reset()
func (*DescribeSecretRequest) String ¶
func (x *DescribeSecretRequest) String() string
type QuerySecretRequest ¶
type QuerySecretRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page,omitempty"` // 关键字参数 // @gotags: json:"keywords" Keywords string `protobuf:"bytes,2,opt,name=keywords,proto3" json:"keywords,omitempty"` // 所属Domain // @gotags: json:"domain" Domain string `protobuf:"bytes,14,opt,name=domain,proto3" json:"domain,omitempty"` // 所属Namespace // @gotags: json:"namespace" Namespace string `protobuf:"bytes,15,opt,name=namespace,proto3" json:"namespace,omitempty"` // contains filtered or unexported fields }
func NewQuerySecret ¶
func NewQuerySecret() *QuerySecretRequest
func NewQuerySecretRequest ¶
func NewQuerySecretRequest(r *http.Request) *QuerySecretRequest
func (*QuerySecretRequest) Descriptor
deprecated
func (*QuerySecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use QuerySecretRequest.ProtoReflect.Descriptor instead.
func (*QuerySecretRequest) GetDomain ¶
func (x *QuerySecretRequest) GetDomain() string
func (*QuerySecretRequest) GetKeywords ¶
func (x *QuerySecretRequest) GetKeywords() string
func (*QuerySecretRequest) GetNamespace ¶
func (x *QuerySecretRequest) GetNamespace() string
func (*QuerySecretRequest) GetPage ¶
func (x *QuerySecretRequest) GetPage() *request.PageRequest
func (*QuerySecretRequest) ProtoMessage ¶
func (*QuerySecretRequest) ProtoMessage()
func (*QuerySecretRequest) ProtoReflect ¶
func (x *QuerySecretRequest) ProtoReflect() protoreflect.Message
func (*QuerySecretRequest) Reset ¶
func (x *QuerySecretRequest) Reset()
func (*QuerySecretRequest) String ¶
func (x *QuerySecretRequest) String() string
type Secret ¶
type Secret struct { // 全局唯一Id // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 创建时间 // @gotags: json:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` // 创建信息 // @gotags: json:"data" Data *CreateSecretRequest `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func NewDefaultSecret ¶
func NewDefaultSecret() *Secret
func NewSecret ¶
func NewSecret(req *CreateSecretRequest) (*Secret, error)
func (*Secret) Descriptor
deprecated
func (*Secret) GetCreateAt ¶
func (*Secret) GetData ¶
func (x *Secret) GetData() *CreateSecretRequest
func (*Secret) ProtoMessage ¶
func (*Secret) ProtoMessage()
func (*Secret) ProtoReflect ¶
func (x *Secret) ProtoReflect() protoreflect.Message
type SecretSet ¶
type SecretSet struct { // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` // @gotags: json:"items" Items []*Secret `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func NewSecretSet ¶
func NewSecretSet() *SecretSet
func (*SecretSet) Descriptor
deprecated
func (*SecretSet) ProtoMessage ¶
func (*SecretSet) ProtoMessage()
func (*SecretSet) ProtoReflect ¶
func (x *SecretSet) ProtoReflect() protoreflect.Message
type ServiceClient ¶
type ServiceClient interface { CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*Secret, error) QuerySecret(ctx context.Context, in *QuerySecretRequest, opts ...grpc.CallOption) (*SecretSet, error) DescribeSecret(ctx context.Context, in *DescribeSecretRequest, opts ...grpc.CallOption) (*Secret, error) DeleteSecret(ctx context.Context, in *DeleteSecretRequest, opts ...grpc.CallOption) (*Secret, error) }
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer 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) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Type ¶
type Type int32
func ParseTypeFromString ¶
ParseTypeFromString Parse Type from string
func (Type) Descriptor ¶
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
func (Type) Number ¶
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶
func (Type) Type() protoreflect.EnumType
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) CreateSecret ¶
func (UnimplementedServiceServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
func (UnimplementedServiceServer) DeleteSecret ¶
func (UnimplementedServiceServer) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error)
func (UnimplementedServiceServer) DescribeSecret ¶
func (UnimplementedServiceServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
func (UnimplementedServiceServer) QuerySecret ¶
func (UnimplementedServiceServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.