Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- type DeleteSecretRequest
- func (*DeleteSecretRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteSecretRequest) GetId() int64
- func (*DeleteSecretRequest) ProtoMessage()
- func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteSecretRequest) Reset()
- func (x *DeleteSecretRequest) String() string
- type DescSecretRequest
- type Meta
- type QuerySecretRequest
- func (*QuerySecretRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QuerySecretRequest) GetKeyword() string
- func (x *QuerySecretRequest) GetPageNum() int64
- func (x *QuerySecretRequest) GetPageSize() int64
- func (x *QuerySecretRequest) GetQueryType() QueryType
- func (*QuerySecretRequest) ProtoMessage()
- func (x *QuerySecretRequest) ProtoReflect() protoreflect.Message
- func (x *QuerySecretRequest) Reset()
- func (x *QuerySecretRequest) String() string
- type QueryType
- type RpcClient
- type RpcServer
- type Rpc_SyncResourceClient
- type Rpc_SyncResourceServer
- type Secret
- type SecretSet
- type Service
- type Spec
- func (*Spec) Descriptor() ([]byte, []int)deprecated
- func (x *Spec) GetAccessKey() string
- func (x *Spec) GetAccessSecret() string
- func (x *Spec) GetDesc() string
- func (x *Spec) GetName() string
- func (x *Spec) GetVendor() Vendor
- 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) GetAccessEndpoint() string
- func (x *SyncResourceRequest) GetRegionId() string
- func (x *SyncResourceRequest) GetSecretId() int64
- func (x *SyncResourceRequest) GetVendor() Vendor
- 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) GetStatus() 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) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error)
- func (UnimplementedRpcServer) DescSecret(context.Context, *DescSecretRequest) (*Secret, error)
- func (UnimplementedRpcServer) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error)
- func (UnimplementedRpcServer) SyncResource(*SyncResourceRequest, Rpc_SyncResourceServer) error
- type UnsafeRpcServer
- type Vendor
Constants ¶
const ( Rpc_CreateSecret_FullMethodName = "/cmdb.secret.Rpc/CreateSecret" Rpc_DeleteSecret_FullMethodName = "/cmdb.secret.Rpc/DeleteSecret" Rpc_QuerySecret_FullMethodName = "/cmdb.secret.Rpc/QuerySecret" Rpc_DescSecret_FullMethodName = "/cmdb.secret.Rpc/DescSecret" Rpc_SyncResource_FullMethodName = "/cmdb.secret.Rpc/SyncResource" )
const AppName = "secret"
Variables ¶
var ( Vendor_name = map[int32]string{ 0: "VENDOR_UNSPECIFIED", 1: "VENDOR_ALI", 2: "VENDOR_TENCENT", } Vendor_value = map[string]int32{ "VENDOR_UNSPECIFIED": 0, "VENDOR_ALI": 1, "VENDOR_TENCENT": 2, } )
Enum value maps for Vendor.
var ( QueryType_name = map[int32]string{ 0: "QUERY_TYPE_UNSPECIFIED", 1: "QUERY_TYPE_DESC", } QueryType_value = map[string]int32{ "QUERY_TYPE_UNSPECIFIED": 0, "QUERY_TYPE_DESC": 1, } )
Enum value maps for QueryType.
var File_apps_secret_pb_model_proto protoreflect.FileDescriptor
var File_apps_secret_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cmdb.secret.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateSecret", Handler: _Rpc_CreateSecret_Handler, }, { MethodName: "DeleteSecret", Handler: _Rpc_DeleteSecret_Handler, }, { MethodName: "QuerySecret", Handler: _Rpc_QuerySecret_Handler, }, { MethodName: "DescSecret", Handler: _Rpc_DescSecret_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SyncResource", Handler: _Rpc_SyncResource_Handler, ServerStreams: true, }, }, 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 DeleteSecretRequest ¶
type DeleteSecretRequest struct { // @gotags: validate:"required" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*DeleteSecretRequest) Descriptor
deprecated
func (*DeleteSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteSecretRequest.ProtoReflect.Descriptor instead.
func (*DeleteSecretRequest) GetId ¶
func (x *DeleteSecretRequest) GetId() int64
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 DescSecretRequest ¶
type DescSecretRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DescSecretRequest) Descriptor
deprecated
func (*DescSecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescSecretRequest.ProtoReflect.Descriptor instead.
func (*DescSecretRequest) GetId ¶
func (x *DescSecretRequest) GetId() int64
func (*DescSecretRequest) ProtoMessage ¶
func (*DescSecretRequest) ProtoMessage()
func (*DescSecretRequest) ProtoReflect ¶
func (x *DescSecretRequest) ProtoReflect() protoreflect.Message
func (*DescSecretRequest) Reset ¶
func (x *DescSecretRequest) Reset()
func (*DescSecretRequest) String ¶
func (x *DescSecretRequest) String() string
type Meta ¶
type Meta struct { // @gotags: json:"created_at" gorm:"primaryKey" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"created_at" gorm:"primaryKey"` // @gotags: json:"created_at" gorm:"autoCreateTime" CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at" gorm:"autoCreateTime"` // @gotags: json:"updated_at" gorm:"autoUpdateTime" UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at" gorm:"autoUpdateTime"` // contains filtered or unexported fields }
func (*Meta) Descriptor
deprecated
func (*Meta) GetCreatedAt ¶
func (*Meta) GetUpdatedAt ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type QuerySecretRequest ¶
type QuerySecretRequest struct { PageNum int64 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"` PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` QueryType QueryType `protobuf:"varint,3,opt,name=query_type,json=queryType,proto3,enum=cmdb.secret.QueryType" json:"query_type,omitempty"` Keyword string `protobuf:"bytes,4,opt,name=keyword,proto3" json:"keyword,omitempty"` // contains filtered or unexported fields }
func (*QuerySecretRequest) Descriptor
deprecated
func (*QuerySecretRequest) Descriptor() ([]byte, []int)
Deprecated: Use QuerySecretRequest.ProtoReflect.Descriptor instead.
func (*QuerySecretRequest) GetKeyword ¶
func (x *QuerySecretRequest) GetKeyword() string
func (*QuerySecretRequest) GetPageNum ¶
func (x *QuerySecretRequest) GetPageNum() int64
func (*QuerySecretRequest) GetPageSize ¶
func (x *QuerySecretRequest) GetPageSize() int64
func (*QuerySecretRequest) GetQueryType ¶
func (x *QuerySecretRequest) GetQueryType() QueryType
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 QueryType ¶
type QueryType int32
func (QueryType) Descriptor ¶
func (QueryType) Descriptor() protoreflect.EnumDescriptor
func (QueryType) EnumDescriptor
deprecated
func (QueryType) Number ¶
func (x QueryType) Number() protoreflect.EnumNumber
func (QueryType) Type ¶
func (QueryType) Type() protoreflect.EnumType
type RpcClient ¶
type RpcClient interface { CreateSecret(ctx context.Context, in *Spec, opts ...grpc.CallOption) (*Secret, error) DeleteSecret(ctx context.Context, in *DeleteSecretRequest, opts ...grpc.CallOption) (*Secret, error) QuerySecret(ctx context.Context, in *QuerySecretRequest, opts ...grpc.CallOption) (*SecretSet, error) DescSecret(ctx context.Context, in *DescSecretRequest, opts ...grpc.CallOption) (*Secret, error) 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) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error) QuerySecret(context.Context, *QuerySecretRequest) (*SecretSet, error) DescSecret(context.Context, *DescSecretRequest) (*Secret, error) 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() (*resource.Resource, error) grpc.ClientStream }
type Rpc_SyncResourceServer ¶
type Rpc_SyncResourceServer interface { Send(*resource.Resource) error grpc.ServerStream }
type Secret ¶
type Secret struct { // @gotags: gorm:"embedded" Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty" gorm:"embedded"` // @gotags: gorm:"embedded" Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty" gorm:"embedded"` // 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 { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Items []*Secret `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // 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: gorm:"type:varchar(50);uniqueIndex:idx_vendor_name" validate:"required" Name string `` /* 133-byte string literal not displayed */ // @gotags: validate:"required" Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty" validate:"required"` // 秘钥所属厂商,阿里云、腾讯云、华为云 // @gotags: gorm:"uniqueIndex:idx_vendor_name" validate:"required" Vendor Vendor `` /* 145-byte string literal not displayed */ // @gotags: validate:"required" AccessKey string `protobuf:"bytes,4,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty" validate:"required"` // @gotags: validate:"required" AccessSecret string `protobuf:"bytes,5,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*Spec) Descriptor
deprecated
func (*Spec) GetAccessKey ¶
func (*Spec) GetAccessSecret ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type SyncResourceRequest ¶
type SyncResourceRequest struct { // vendor 主要用来匹配对应的 provider // @gotags: validate:"required" Vendor Vendor `protobuf:"varint,1,opt,name=vendor,proto3,enum=cmdb.secret.Vendor" json:"vendor,omitempty" validate:"required"` // @gotags: validate:"required" SecretId int64 `protobuf:"varint,2,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty" validate:"required"` // @gotags: validate:"required" AccessEndpoint string `protobuf:"bytes,4,opt,name=access_endpoint,json=accessEndpoint,proto3" json:"access_endpoint,omitempty" validate:"required"` RegionId string `protobuf:"bytes,5,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` // contains filtered or unexported fields }
使用哪个秘钥、去同步哪个区域的数据
func (*SyncResourceRequest) Descriptor
deprecated
func (*SyncResourceRequest) Descriptor() ([]byte, []int)
Deprecated: Use SyncResourceRequest.ProtoReflect.Descriptor instead.
func (*SyncResourceRequest) GetAccessEndpoint ¶
func (x *SyncResourceRequest) GetAccessEndpoint() string
func (*SyncResourceRequest) GetRegionId ¶
func (x *SyncResourceRequest) GetRegionId() string
func (*SyncResourceRequest) GetSecretId ¶
func (x *SyncResourceRequest) GetSecretId() int64
func (*SyncResourceRequest) GetVendor ¶
func (x *SyncResourceRequest) GetVendor() Vendor
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 { Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // 同步状态;成功、失败 Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 同步执行的额外信息 // 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) GetStatus ¶
func (x *SyncResourceResponse) GetStatus() 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) DeleteSecret ¶
func (UnimplementedRpcServer) DeleteSecret(context.Context, *DeleteSecretRequest) (*Secret, error)
func (UnimplementedRpcServer) DescSecret ¶
func (UnimplementedRpcServer) DescSecret(context.Context, *DescSecretRequest) (*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.
type Vendor ¶
type Vendor int32
func (Vendor) Descriptor ¶
func (Vendor) Descriptor() protoreflect.EnumDescriptor
func (Vendor) EnumDescriptor
deprecated
func (Vendor) Number ¶
func (x Vendor) Number() protoreflect.EnumNumber
func (Vendor) Type ¶
func (Vendor) Type() protoreflect.EnumType