Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type CreateSecretRequest
- func (*CreateSecretRequest) Descriptor() ([]byte, []int)deprecated
- func (i *CreateSecretRequest) Desense()
- func (x *CreateSecretRequest) GetAddress() string
- func (x *CreateSecretRequest) GetApiKey() string
- func (x *CreateSecretRequest) GetApiSecret() string
- func (x *CreateSecretRequest) GetDescription() string
- func (x *CreateSecretRequest) GetEnabled() bool
- func (x *CreateSecretRequest) GetProvider() PROVIDER
- func (x *CreateSecretRequest) GetRequestRate() int32
- func (*CreateSecretRequest) ProtoMessage()
- func (x *CreateSecretRequest) ProtoReflect() protoreflect.Message
- func (x *CreateSecretRequest) Reset()
- func (x *CreateSecretRequest) String() string
- func (req *CreateSecretRequest) TableName() string
- func (req *CreateSecretRequest) Validate() error
- 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 Meta
- type PROVIDER
- type QuerySecretRequest
- func (*QuerySecretRequest) Descriptor() ([]byte, []int)deprecated
- 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 RPCClient
- type RPCServer
- type Secret
- func (i *Secret) DecryptAPISecret(key string) error
- func (*Secret) Descriptor() ([]byte, []int)deprecated
- func (i *Secret) EncryptAPISecret(key string) error
- func (x *Secret) GetMeta() *Meta
- func (x *Secret) GetSpec() *CreateSecretRequest
- 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 Service
- type UnimplementedRPCServer
- func (UnimplementedRPCServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
- func (UnimplementedRPCServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
- func (UnimplementedRPCServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
- type UnsafeRPCServer
Constants ¶
const (
AppName = "secrets"
)
const (
EncryptKey = "test01"
)
Variables ¶
var ( PROVIDER_name = map[int32]string{ 0: "TENCENT_CLOUD", } PROVIDER_value = map[string]int32{ "TENCENT_CLOUD": 0, } )
Enum value maps for PROVIDER.
var File_apps_secret_pb_rpc_proto protoreflect.FileDescriptor
var File_apps_secret_pb_secret_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go9.devcloud.cmdb.secret.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateSecret", Handler: _RPC_CreateSecret_Handler, }, { MethodName: "QuerySecret", Handler: _RPC_QuerySecret_Handler, }, { MethodName: "DescribeSecret", Handler: _RPC_DescribeSecret_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/secret/pb/rpc.proto", }
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRPCServer ¶
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
Types ¶
type CreateSecretRequest ¶
type CreateSecretRequest struct { // 供应商 // @gotags: json:"provider" Provider PROVIDER `protobuf:"varint,1,opt,name=provider,proto3,enum=go9.devcloud.cmdb.secret.PROVIDER" json:"provider"` // 服务地址 // @gotags: json:"address" Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address"` // api调用key // @gotags: json:"api_key" validate:"required" ApiKey string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key" validate:"required"` // api调用secret // @gotags: json:"api_secret" validate:"required" ApiSecret string `protobuf:"bytes,3,opt,name=api_secret,json=apiSecret,proto3" json:"api_secret" validate:"required"` // secret描述 // @gotags: json:"description" validate:"required" Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description" validate:"required"` // secret请求接口访问速率 // @gotags: json:"request_rate" RequestRate int32 `protobuf:"varint,7,opt,name=request_rate,json=requestRate,proto3" json:"request_rate"` // 是否启用 Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
资源同步凭证管理
func NewCreateSecretRequest ¶
func NewCreateSecretRequest() *CreateSecretRequest
func (*CreateSecretRequest) Descriptor
deprecated
func (*CreateSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateSecretRequest.ProtoReflect.Descriptor instead.
func (*CreateSecretRequest) Desense ¶
func (i *CreateSecretRequest) Desense()
func (*CreateSecretRequest) GetAddress ¶
func (x *CreateSecretRequest) GetAddress() string
func (*CreateSecretRequest) GetApiKey ¶
func (x *CreateSecretRequest) GetApiKey() string
func (*CreateSecretRequest) GetApiSecret ¶
func (x *CreateSecretRequest) GetApiSecret() string
func (*CreateSecretRequest) GetDescription ¶
func (x *CreateSecretRequest) GetDescription() string
func (*CreateSecretRequest) GetEnabled ¶
func (x *CreateSecretRequest) GetEnabled() bool
func (*CreateSecretRequest) GetProvider ¶
func (x *CreateSecretRequest) GetProvider() PROVIDER
func (*CreateSecretRequest) GetRequestRate ¶
func (x *CreateSecretRequest) GetRequestRate() int32
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) TableName ¶
func (req *CreateSecretRequest) TableName() string
func (*CreateSecretRequest) Validate ¶
func (req *CreateSecretRequest) Validate() error
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 Meta ¶
type Meta struct { // @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"` // contains filtered or unexported fields }
func (*Meta) Descriptor
deprecated
func (*Meta) GetCreateAt ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type PROVIDER ¶
type PROVIDER int32
const ( // 腾讯云 PROVIDER_TENCENT_CLOUD PROVIDER = 0 )
func (PROVIDER) Descriptor ¶
func (PROVIDER) Descriptor() protoreflect.EnumDescriptor
func (PROVIDER) EnumDescriptor
deprecated
func (PROVIDER) Number ¶
func (x PROVIDER) Number() protoreflect.EnumNumber
func (PROVIDER) Type ¶
func (PROVIDER) Type() protoreflect.EnumType
type QuerySecretRequest ¶
type QuerySecretRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // contains filtered or unexported fields }
func NewQuerySecretRequest ¶
func NewQuerySecretRequest() *QuerySecretRequest
func (*QuerySecretRequest) Descriptor
deprecated
func (*QuerySecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use QuerySecretRequest.ProtoReflect.Descriptor instead.
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 RPCClient ¶
type RPCClient 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) }
RPCClient is the client API for RPC 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 NewRPCClient ¶
func NewRPCClient(cc grpc.ClientConnInterface) RPCClient
type RPCServer ¶
type RPCServer interface { // 创建凭证 CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error) // 查询凭证详情 QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error) // 查询凭证详情 DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type Secret ¶
type Secret struct { // meta定义 // @gotags: json:"meta" Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` // secret定义 // @gotags: json:"spec" Spec *CreateSecretRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec"` // contains filtered or unexported fields }
func New ¶
func New(req *CreateSecretRequest) *Secret
func (*Secret) Descriptor
deprecated
func (*Secret) GetSpec ¶
func (x *Secret) GetSpec() *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 Service ¶
type Service interface { // 通过该凭证的资源 SyncResource(context.Context, *DescribeSecretRequest) error RPCServer }
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) CreateSecret ¶
func (UnimplementedRPCServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
func (UnimplementedRPCServer) DescribeSecret ¶
func (UnimplementedRPCServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
func (UnimplementedRPCServer) QuerySecret ¶
func (UnimplementedRPCServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
type UnsafeRPCServer ¶
type UnsafeRPCServer interface {
// contains filtered or unexported methods
}
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.