Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- 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
- type RpcClient
- type RpcServer
- type Rpc_SyncResourceClient
- type Rpc_SyncResourceServer
- type Secret
- type SecretSet
- type Service
- type Spec
- func (s *Spec) Decrypt() error
- func (*Spec) Descriptor() ([]byte, []int)deprecated
- func (s *Spec) Encrypt() error
- func (x *Spec) GetApiKey() string
- func (x *Spec) GetApiSecret() string
- func (x *Spec) GetEnabled() bool
- func (x *Spec) GetProvider() resource1.PROVIDER
- func (x *Spec) GetResourceRegions() []string
- func (*Spec) ProtoMessage()
- func (x *Spec) ProtoReflect() protoreflect.Message
- func (x *Spec) Reset()
- func (x *Spec) String() string
- type SyncResourceRequest
- func (*SyncResourceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SyncResourceRequest) GetSecretId() string
- func (*SyncResourceRequest) ProtoMessage()
- func (x *SyncResourceRequest) ProtoReflect() protoreflect.Message
- func (x *SyncResourceRequest) Reset()
- func (x *SyncResourceRequest) String() string
- type SyncResourceResponse
- func (*SyncResourceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SyncResourceResponse) GetMessage() string
- func (x *SyncResourceResponse) GetResourceId() string
- func (x *SyncResourceResponse) GetSuccessed() bool
- func (*SyncResourceResponse) ProtoMessage()
- func (x *SyncResourceResponse) ProtoReflect() protoreflect.Message
- func (x *SyncResourceResponse) Reset()
- func (x *SyncResourceResponse) String() string
- type UnimplementedRpcServer
- func (UnimplementedRpcServer) CreateSecret(context.Context, *Spec) (*Secret, error)
- func (UnimplementedRpcServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
- func (UnimplementedRpcServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
- func (UnimplementedRpcServer) SyncResource(*SyncResourceRequest, Rpc_SyncResourceServer) error
- type UnsafeRpcServer
Constants ¶
const ( AppName = "secrets" AppVersion = "v1" )
const ( Rpc_CreateSecret_FullMethodName = "/go11.devcloud_mini.cmdb.secret.Rpc/CreateSecret" Rpc_QuerySecret_FullMethodName = "/go11.devcloud_mini.cmdb.secret.Rpc/QuerySecret" Rpc_DescribeSecret_FullMethodName = "/go11.devcloud_mini.cmdb.secret.Rpc/DescribeSecret" Rpc_SyncResource_FullMethodName = "/go11.devcloud_mini.cmdb.secret.Rpc/SyncResource" )
Variables ¶
var File_cmdb_apps_secret_pb_model_proto protoreflect.FileDescriptor
var File_cmdb_apps_secret_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go11.devcloud_mini.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{ { StreamName: "SyncResource", Handler: _Rpc_SyncResource_Handler, ServerStreams: true, }, }, Metadata: "cmdb/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 DescribeSecretRequest ¶
type DescribeSecretRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
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 {
// contains filtered or unexported fields
}
func (*QuerySecretRequest) Descriptor
deprecated
func (*QuerySecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use QuerySecretRequest.ProtoReflect.Descriptor instead.
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 *Spec, opts ...grpc.CallOption) (*Secret, error) // 查询同步凭证,查询列表的时候,不要把key查出来 QuerySecret(ctx context.Context, in *QuerySecretRequest, opts ...grpc.CallOption) (*SecretSet, error) // 查询凭证详情 DescribeSecret(ctx context.Context, in *DescribeSecretRequest, opts ...grpc.CallOption) (*Secret, error) // 流式接口,边同步边返回 // host 01 已经同步 // host 02 已经同步 SyncResource(ctx context.Context, in *SyncResourceRequest, opts ...grpc.CallOption) (Rpc_SyncResourceClient, 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, *Spec) (*Secret, error) // 查询同步凭证,查询列表的时候,不要把key查出来 QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error) // 查询凭证详情 DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error) // 流式接口,边同步边返回 // host 01 已经同步 // host 02 已经同步 SyncResource(*SyncResourceRequest, Rpc_SyncResourceServer) error // contains filtered or unexported methods }
RpcServer is the server API for Rpc service. All implementations must embed UnimplementedRpcServer for forward compatibility
type Rpc_SyncResourceClient ¶
type Rpc_SyncResourceClient interface { Recv() (*SyncResourceResponse, error) grpc.ClientStream }
type Rpc_SyncResourceServer ¶
type Rpc_SyncResourceServer interface { Send(*SyncResourceResponse) error grpc.ServerStream }
type Secret ¶
type Secret struct { // 元数据信息 // @gotags: json:"meta" bson:",inline" Meta *resource.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"` // 资源的定义 // @gotags: json:"spec" bson:",inline" Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"` // contains filtered or unexported fields }
func (*Secret) Descriptor
deprecated
func (*Secret) ProtoMessage ¶
func (*Secret) ProtoMessage()
func (*Secret) ProtoReflect ¶
func (x *Secret) ProtoReflect() protoreflect.Message
type SecretSet ¶
type SecretSet struct { // 总数 // @gotags: json:"total" bson:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` // 清单 // @gotags: json:"items" bson:"items" Items []*Secret `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*SecretSet) Descriptor
deprecated
func (*SecretSet) ProtoMessage ¶
func (*SecretSet) ProtoMessage()
func (*SecretSet) ProtoReflect ¶
func (x *SecretSet) ProtoReflect() protoreflect.Message
type Spec ¶
type Spec struct { // 是否启用,不启用就不能进行资源同步 // @gotags: json:"enabled" bson:"enabled" Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled" bson:"enabled"` // 腾讯云: SecretId // @gotags: json:"api_key" bson:"api_key" ApiKey string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key" bson:"api_key"` // 腾讯云: SecretKey // @gotags: json:"api_secret" bson:"api_secret" ApiSecret string `protobuf:"bytes,3,opt,name=api_secret,json=apiSecret,proto3" json:"api_secret" bson:"api_secret"` // 资源的提供方 // @gotags: json:"provider" bson:"provider" Provider resource1.PROVIDER `protobuf:"varint,4,opt,name=provider,proto3,enum=go11.devcloud_mini.cmdb.resource.PROVIDER" json:"provider" bson:"provider"` // 该帐号 往哪些地域(Region)上的资源,需要运维者或者业务提前规划,杭州,北京,上海 // @gotags: json:"resource_regions" bson:"resource_regions" ResourceRegions []string `protobuf:"bytes,5,rep,name=resource_regions,json=resourceRegions,proto3" json:"resource_regions" bson:"resource_regions"` // contains filtered or unexported fields }
func (*Spec) Descriptor
deprecated
func (*Spec) GetApiSecret ¶
func (*Spec) GetEnabled ¶
func (*Spec) GetProvider ¶
func (*Spec) GetResourceRegions ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type SyncResourceRequest ¶
type SyncResourceRequest struct { SecretId string `protobuf:"bytes,1,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` // contains filtered or unexported fields }
func (*SyncResourceRequest) Descriptor
deprecated
func (*SyncResourceRequest) Descriptor() ([]byte, []int)
Deprecated: Use SyncResourceRequest.ProtoReflect.Descriptor instead.
func (*SyncResourceRequest) GetSecretId ¶
func (x *SyncResourceRequest) GetSecretId() string
func (*SyncResourceRequest) ProtoMessage ¶
func (*SyncResourceRequest) ProtoMessage()
func (*SyncResourceRequest) ProtoReflect ¶
func (x *SyncResourceRequest) ProtoReflect() protoreflect.Message
func (*SyncResourceRequest) Reset ¶
func (x *SyncResourceRequest) Reset()
func (*SyncResourceRequest) String ¶
func (x *SyncResourceRequest) String() string
type SyncResourceResponse ¶
type SyncResourceResponse struct { // 资源Id // @gotags: json:"resource_id" bson:"resource_id" ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id" bson:"resource_id"` // 是否同步成功 // @gotags: json:"successed" bson:"successed" Successed bool `protobuf:"varint,2,opt,name=successed,proto3" json:"successed" bson:"successed"` // 同步成功或失败返回的信息 // @gotags: json:"message" bson:"message" Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message" bson:"message"` // contains filtered or unexported fields }
func (*SyncResourceResponse) Descriptor
deprecated
func (*SyncResourceResponse) Descriptor() ([]byte, []int)
Deprecated: Use SyncResourceResponse.ProtoReflect.Descriptor instead.
func (*SyncResourceResponse) GetMessage ¶
func (x *SyncResourceResponse) GetMessage() string
func (*SyncResourceResponse) GetResourceId ¶
func (x *SyncResourceResponse) GetResourceId() string
func (*SyncResourceResponse) GetSuccessed ¶
func (x *SyncResourceResponse) GetSuccessed() bool
func (*SyncResourceResponse) ProtoMessage ¶
func (*SyncResourceResponse) ProtoMessage()
func (*SyncResourceResponse) ProtoReflect ¶
func (x *SyncResourceResponse) ProtoReflect() protoreflect.Message
func (*SyncResourceResponse) Reset ¶
func (x *SyncResourceResponse) Reset()
func (*SyncResourceResponse) String ¶
func (x *SyncResourceResponse) String() string
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct { }
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) CreateSecret ¶
func (UnimplementedRpcServer) DescribeSecret ¶
func (UnimplementedRpcServer) DescribeSecret(context.Context, *DescribeSecretRequest) (*Secret, error)
func (UnimplementedRpcServer) QuerySecret ¶
func (UnimplementedRpcServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
func (UnimplementedRpcServer) SyncResource ¶
func (UnimplementedRpcServer) SyncResource(*SyncResourceRequest, Rpc_SyncResourceServer) 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.