Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type CreateSecretRequest
- func (s *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) GetCreateBy() string
- func (x *CreateSecretRequest) GetCrendentialType() Type
- func (x *CreateSecretRequest) GetDescription() string
- func (x *CreateSecretRequest) GetRequestRate() int32
- func (x *CreateSecretRequest) GetVendor() resource.Vendor
- func (s *CreateSecretRequest) LoadAllowRegionFromString(regions 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 PageRequest
- func (p *PageRequest) ComputeOffset() int64
- func (*PageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PageRequest) GetOffset() int64
- func (x *PageRequest) GetPageNumber() uint64
- func (x *PageRequest) GetPageSize() uint64
- func (*PageRequest) ProtoMessage()
- func (x *PageRequest) ProtoReflect() protoreflect.Message
- func (x *PageRequest) Reset()
- func (x *PageRequest) 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() *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 (s *SecretSet) Add(item *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
- type UpdateMode
Constants ¶
const ( AppName = "secret" // DefaultPageSize 默认分页大小 DefaultPageSize = 20 // DefaultPageNumber 默认页号 DefaultPageNumber = 1 )
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 ( UpdateMode_name = map[int32]string{ 0: "PUT", 1: "PATCH", } UpdateMode_value = map[string]int32{ "PUT": 0, "PATCH": 1, } )
Enum value maps for UpdateMode.
var File_apps_secret_pb_secret_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ginkgo_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" validate:"required,lte=100"` // 厂商 // @gotags: json:"vendor" Vendor resource.Vendor `protobuf:"varint,2,opt,name=vendor,proto3,enum=ginkgo_cmdb.resource.Vendor" json:"vendor"` // 允许同步的区域 // @gotags: json:"allow_regions" AllowRegions []string `protobuf:"bytes,3,rep,name=allow_regions,json=allowRegions,proto3" json:"allow_regions"` // 凭证类型 // @gotags: json:"crendential_type" CrendentialType Type `` /* 126-byte string literal not displayed */ // 服务地址, 云商不用填写 // @gotags: json:"address" Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address"` // key // @gotags: json:"api_key" validate:"required,lte=100" ApiKey string `protobuf:"bytes,6,opt,name=api_key,json=apiKey,proto3" json:"api_key" validate:"required,lte=100"` // secrete // @gotags: json:"api_secret" validate:"required,lte=100" ApiSecret string `protobuf:"bytes,7,opt,name=api_secret,json=apiSecret,proto3" json:"api_secret" validate:"required,lte=100"` // 请求速率限制, 默认1秒5个 // @gotags: json:"request_rate" RequestRate int32 `protobuf:"varint,8,opt,name=request_rate,json=requestRate,proto3" json:"request_rate"` // 创建者 // @gotags: json:"create_by" CreateBy string `protobuf:"bytes,9,opt,name=create_by,json=createBy,proto3" json:"create_by"` // contains filtered or unexported fields }
func NewCreateSecretRequest ¶
func NewCreateSecretRequest() *CreateSecretRequest
func (*CreateSecretRequest) AllowRegionString ¶
func (s *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) GetCreateBy ¶
func (x *CreateSecretRequest) GetCreateBy() 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 (s *CreateSecretRequest) LoadAllowRegionFromString(regions 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 PageRequest ¶
type PageRequest struct { PageSize uint64 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageNumber uint64 `protobuf:"varint,2,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func NewDefaultPageRequest ¶
func NewDefaultPageRequest() *PageRequest
func NewPageRequestFromHTTP ¶
func NewPageRequestFromHTTP(req *http.Request) *PageRequest
NewPageRequestFromHTTP 从HTTP请求中加载分页请求
func (*PageRequest) ComputeOffset ¶
func (p *PageRequest) ComputeOffset() int64
GetOffset skip 如果传入了offset则使用传入的offset参数
func (*PageRequest) Descriptor
deprecated
func (*PageRequest) Descriptor() ([]byte, []int)
Deprecated: Use PageRequest.ProtoReflect.Descriptor instead.
func (*PageRequest) GetOffset ¶
func (x *PageRequest) GetOffset() int64
func (*PageRequest) GetPageNumber ¶
func (x *PageRequest) GetPageNumber() uint64
func (*PageRequest) GetPageSize ¶
func (x *PageRequest) GetPageSize() uint64
func (*PageRequest) ProtoMessage ¶
func (*PageRequest) ProtoMessage()
func (*PageRequest) ProtoReflect ¶
func (x *PageRequest) ProtoReflect() protoreflect.Message
func (*PageRequest) Reset ¶
func (x *PageRequest) Reset()
func (*PageRequest) String ¶
func (x *PageRequest) String() string
type QuerySecretRequest ¶
type QuerySecretRequest struct { // 分页参数 // @gotags: json:"page" Page *PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 关键字参数 // @gotags: json:"keywords" Keywords string `protobuf:"bytes,2,opt,name=keywords,proto3" json:"keywords"` // 所属Domain // @gotags: json:"domain" Domain string `protobuf:"bytes,14,opt,name=domain,proto3" json:"domain"` // 所属Namespace // @gotags: json:"namespace" Namespace string `protobuf:"bytes,15,opt,name=namespace,proto3" json:"namespace"` // contains filtered or unexported fields }
func NewQuerySecretRequest ¶
func NewQuerySecretRequest() *QuerySecretRequest
func NewQuerySecretRequestFromHTTP ¶
func NewQuerySecretRequestFromHTTP(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() *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"` // 创建时间 // @gotags: json:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at"` // 创建信息 // @gotags: json:"data" Data *CreateSecretRequest `protobuf:"bytes,3,opt,name=data,proto3" json:"data"` // 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"` // @gotags: json:"items" Items []*Secret `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // 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 ParseCrendentialTypeFromString ¶
ParseCrendentialTypeFromString 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.
type UpdateMode ¶
type UpdateMode int32
const ( UpdateMode_PUT UpdateMode = 0 UpdateMode_PATCH UpdateMode = 1 )
func (UpdateMode) Descriptor ¶
func (UpdateMode) Descriptor() protoreflect.EnumDescriptor
func (UpdateMode) Enum ¶
func (x UpdateMode) Enum() *UpdateMode
func (UpdateMode) EnumDescriptor
deprecated
func (UpdateMode) EnumDescriptor() ([]byte, []int)
Deprecated: Use UpdateMode.Descriptor instead.
func (UpdateMode) Number ¶
func (x UpdateMode) Number() protoreflect.EnumNumber
func (UpdateMode) String ¶
func (x UpdateMode) String() string
func (UpdateMode) Type ¶
func (UpdateMode) Type() protoreflect.EnumType