Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type CreateServiceRequest
- func (*CreateServiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateServiceRequest) GetDescription() string
- func (x *CreateServiceRequest) GetDomain() string
- func (x *CreateServiceRequest) GetEnabled() bool
- func (x *CreateServiceRequest) GetLevel() uint32
- func (x *CreateServiceRequest) GetName() string
- func (x *CreateServiceRequest) GetNamespace() string
- func (x *CreateServiceRequest) GetOwner() string
- func (x *CreateServiceRequest) GetRepository() *Repository
- func (x *CreateServiceRequest) GetTags() map[string]string
- func (x *CreateServiceRequest) GetType() Type
- func (*CreateServiceRequest) ProtoMessage()
- func (x *CreateServiceRequest) ProtoReflect() protoreflect.Message
- func (x *CreateServiceRequest) Reset()
- func (x *CreateServiceRequest) String() string
- func (req *CreateServiceRequest) Validate() error
- type Credential
- func (*Credential) Descriptor() ([]byte, []int)deprecated
- func (x *Credential) GetClientId() string
- func (x *Credential) GetClientSecret() string
- func (x *Credential) GetEnabled() bool
- func (x *Credential) GetUpdateAt() int64
- func (*Credential) ProtoMessage()
- func (x *Credential) ProtoReflect() protoreflect.Message
- func (x *Credential) Reset()
- func (x *Credential) String() string
- func (c *Credential) Validate(clientSecret string) error
- type DescribeBy
- func (DescribeBy) Descriptor() protoreflect.EnumDescriptor
- func (x DescribeBy) Enum() *DescribeBy
- func (DescribeBy) EnumDescriptor() ([]byte, []int)deprecated
- func (t DescribeBy) Equal(target DescribeBy) bool
- func (t DescribeBy) IsIn(targets ...DescribeBy) bool
- func (t DescribeBy) MarshalJSON() ([]byte, error)
- func (x DescribeBy) Number() protoreflect.EnumNumber
- func (x DescribeBy) String() string
- func (DescribeBy) Type() protoreflect.EnumType
- func (t *DescribeBy) UnmarshalJSON(b []byte) error
- type DescribeServiceRequest
- func (*DescribeServiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeServiceRequest) GetClientId() string
- func (x *DescribeServiceRequest) GetDescribeBy() DescribeBy
- func (x *DescribeServiceRequest) GetId() string
- func (x *DescribeServiceRequest) GetName() string
- func (*DescribeServiceRequest) ProtoMessage()
- func (x *DescribeServiceRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeServiceRequest) Reset()
- func (x *DescribeServiceRequest) String() string
- type LANGUAGE
- func (LANGUAGE) Descriptor() protoreflect.EnumDescriptor
- func (x LANGUAGE) Enum() *LANGUAGE
- func (LANGUAGE) EnumDescriptor() ([]byte, []int)deprecated
- func (t LANGUAGE) Equal(target LANGUAGE) bool
- func (t LANGUAGE) IsIn(targets ...LANGUAGE) bool
- func (t LANGUAGE) MarshalJSON() ([]byte, error)
- func (x LANGUAGE) Number() protoreflect.EnumNumber
- func (x LANGUAGE) String() string
- func (LANGUAGE) Type() protoreflect.EnumType
- func (t *LANGUAGE) UnmarshalJSON(b []byte) error
- type MetaService
- type RPCClient
- type RPCServer
- type Repository
- func (*Repository) Descriptor() ([]byte, []int)deprecated
- func (x *Repository) GetHookError() string
- func (x *Repository) GetHookId() string
- func (x *Repository) GetHttpUrl() string
- func (x *Repository) GetLanguage() LANGUAGE
- func (x *Repository) GetProjectId() string
- func (x *Repository) GetProvider() SCM_PROVIDER
- func (x *Repository) GetSshUrl() string
- func (x *Repository) GetToken() string
- func (*Repository) ProtoMessage()
- func (x *Repository) ProtoReflect() protoreflect.Message
- func (x *Repository) Reset()
- func (x *Repository) String() string
- type SCM_PROVIDER
- func (SCM_PROVIDER) Descriptor() protoreflect.EnumDescriptor
- func (x SCM_PROVIDER) Enum() *SCM_PROVIDER
- func (SCM_PROVIDER) EnumDescriptor() ([]byte, []int)deprecated
- func (t SCM_PROVIDER) Equal(target SCM_PROVIDER) bool
- func (t SCM_PROVIDER) IsIn(targets ...SCM_PROVIDER) bool
- func (t SCM_PROVIDER) MarshalJSON() ([]byte, error)
- func (x SCM_PROVIDER) Number() protoreflect.EnumNumber
- func (x SCM_PROVIDER) String() string
- func (SCM_PROVIDER) Type() protoreflect.EnumType
- func (t *SCM_PROVIDER) UnmarshalJSON(b []byte) error
- type Security
- type Service
- func (*Service) Descriptor() ([]byte, []int)deprecated
- func (i *Service) FullName() string
- func (i *Service) FullNameHash() string
- func (x *Service) GetCreateAt() int64
- func (x *Service) GetCredential() *Credential
- func (x *Service) GetId() string
- func (x *Service) GetSecurity() *Security
- func (x *Service) GetSpec() *CreateServiceRequest
- func (x *Service) GetUpdateAt() int64
- func (x *Service) GetUpdateBy() string
- func (*Service) ProtoMessage()
- func (x *Service) ProtoReflect() protoreflect.Message
- func (x *Service) Reset()
- func (x *Service) String() string
- 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 UnimplementedRPCServer
- type UnsafeRPCServer
- type ValidateCredentialRequest
- func (*ValidateCredentialRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateCredentialRequest) GetClientId() string
- func (x *ValidateCredentialRequest) GetClientSecret() string
- func (*ValidateCredentialRequest) ProtoMessage()
- func (x *ValidateCredentialRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateCredentialRequest) Reset()
- func (x *ValidateCredentialRequest) String() string
Constants ¶
const ( ClientHeaderKey = "client-id" ClientSecretKey = "client-secret" )
const (
AppName = "service"
)
Variables ¶
var ( DescribeBy_name = map[int32]string{ 0: "SERVICE_ID", 1: "SERVICE_NAME", 2: "SERVICE_CLIENT_ID", } DescribeBy_value = map[string]int32{ "SERVICE_ID": 0, "SERVICE_NAME": 1, "SERVICE_CLIENT_ID": 2, } )
Enum value maps for DescribeBy.
var ( Type_name = map[int32]string{ 0: "SYSTEM", 1: "USER", 9: "THIRD", } Type_value = map[string]int32{ "SYSTEM": 0, "USER": 1, "THIRD": 9, } )
Enum value maps for Type.
var ( SCM_PROVIDER_name = map[int32]string{ 0: "GITLAB", 1: "GITHUB", 2: "CODING", } SCM_PROVIDER_value = map[string]int32{ "GITLAB": 0, "GITHUB": 1, "CODING": 2, } )
Enum value maps for SCM_PROVIDER.
var ( LANGUAGE_name = map[int32]string{ 0: "JAVA", 1: "JAVASCRIPT", 2: "GOLANG", 3: "PYTHON", 4: "PHP", 5: "C_SHARP", 6: "C", 7: "C_PLUS_PLUS", 8: "SWIFT", 9: "OBJECT_C", 10: "RUST", 11: "RUBY", 12: "DART", 13: "KOTLIN", 14: "SHELL", 15: "POWER_SHELL", } LANGUAGE_value = map[string]int32{ "JAVA": 0, "JAVASCRIPT": 1, "GOLANG": 2, "PYTHON": 3, "PHP": 4, "C_SHARP": 5, "C": 6, "C_PLUS_PLUS": 7, "SWIFT": 8, "OBJECT_C": 9, "RUST": 10, "RUBY": 11, "DART": 12, "KOTLIN": 13, "SHELL": 14, "POWER_SHELL": 15, } )
Enum value maps for LANGUAGE.
var File_apps_service_pb_rpc_proto protoreflect.FileDescriptor
var File_apps_service_pb_service_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go8.devcloud.mcenter.service.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ValidateCredential", Handler: _RPC_ValidateCredential_Handler, }, { MethodName: "DescribeService", Handler: _RPC_DescribeService_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/service/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 CreateServiceRequest ¶
type CreateServiceRequest struct { // 服务所属域 // @gotags: bson:"domain" json:"domain" Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain" bson:"domain"` // 服务所属空间 // @gotags: bson:"namespace" json:"namespace" Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace" bson:"namespace"` // 应用所有者 // @gotags: bson:"owner" json:"owner" Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner" bson:"owner"` // 是否启用该服务, 服务如果被停用,将不会被发现 // @gotags: bson:"enabled" json:"enabled" Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled" bson:"enabled"` // 服务类型 // @gotags: bson:"type" json:"type" Type Type `protobuf:"varint,5,opt,name=type,proto3,enum=go8.devcloud.mcenter.service.Type" json:"type" bson:"type"` // 服务名称 // @gotags: bson:"name" json:"name" Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name" bson:"name"` // 服务描述信息 // @gotags: bson:"description" json:"description" Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description" bson:"description"` // 服务等级, 默认0 // @gotags: bson:"level" json:"level" Level uint32 `protobuf:"varint,8,opt,name=level,proto3" json:"level" bson:"level"` // 仓库地址 // @gotags: bson:"repository" json:"repository" Repository *Repository `protobuf:"bytes,9,opt,name=repository,proto3" json:"repository" bson:"repository"` // 服务标签 // @gotags: bson:"tags" json:"tags" Tags map[string]string `` /* 152-byte string literal not displayed */ // contains filtered or unexported fields }
func NewCreateServiceRequest ¶
func NewCreateServiceRequest() *CreateServiceRequest
func (*CreateServiceRequest) Descriptor
deprecated
func (*CreateServiceRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateServiceRequest.ProtoReflect.Descriptor instead.
func (*CreateServiceRequest) GetDescription ¶
func (x *CreateServiceRequest) GetDescription() string
func (*CreateServiceRequest) GetDomain ¶
func (x *CreateServiceRequest) GetDomain() string
func (*CreateServiceRequest) GetEnabled ¶
func (x *CreateServiceRequest) GetEnabled() bool
func (*CreateServiceRequest) GetLevel ¶
func (x *CreateServiceRequest) GetLevel() uint32
func (*CreateServiceRequest) GetName ¶
func (x *CreateServiceRequest) GetName() string
func (*CreateServiceRequest) GetNamespace ¶
func (x *CreateServiceRequest) GetNamespace() string
func (*CreateServiceRequest) GetOwner ¶
func (x *CreateServiceRequest) GetOwner() string
func (*CreateServiceRequest) GetRepository ¶
func (x *CreateServiceRequest) GetRepository() *Repository
func (*CreateServiceRequest) GetTags ¶
func (x *CreateServiceRequest) GetTags() map[string]string
func (*CreateServiceRequest) GetType ¶
func (x *CreateServiceRequest) GetType() Type
func (*CreateServiceRequest) ProtoMessage ¶
func (*CreateServiceRequest) ProtoMessage()
func (*CreateServiceRequest) ProtoReflect ¶
func (x *CreateServiceRequest) ProtoReflect() protoreflect.Message
func (*CreateServiceRequest) Reset ¶
func (x *CreateServiceRequest) Reset()
func (*CreateServiceRequest) String ¶
func (x *CreateServiceRequest) String() string
func (*CreateServiceRequest) Validate ¶
func (req *CreateServiceRequest) Validate() error
type Credential ¶
type Credential struct { // 是否启动客户端 // @gotags: bson:"enabled" json:"enabled" Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled" bson:"enabled"` // 凭证更新时间 // @gotags: bson:"update_at" json:"update_at" UpdateAt int64 `protobuf:"varint,2,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"` // 服务客户端ID // @gotags: bson:"client_id" json:"client_id" ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id" bson:"client_id"` // 服务客户端凭证 // @gotags: bson:"client_secret" json:"client_secret" ClientSecret string `protobuf:"bytes,4,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret" bson:"client_secret"` // contains filtered or unexported fields }
func NewRandomCredential ¶
func NewRandomCredential() *Credential
func (*Credential) Descriptor
deprecated
func (*Credential) Descriptor() ([]byte, []int)
Deprecated: Use Credential.ProtoReflect.Descriptor instead.
func (*Credential) GetClientId ¶
func (x *Credential) GetClientId() string
func (*Credential) GetClientSecret ¶
func (x *Credential) GetClientSecret() string
func (*Credential) GetEnabled ¶
func (x *Credential) GetEnabled() bool
func (*Credential) GetUpdateAt ¶
func (x *Credential) GetUpdateAt() int64
func (*Credential) ProtoMessage ¶
func (*Credential) ProtoMessage()
func (*Credential) ProtoReflect ¶
func (x *Credential) ProtoReflect() protoreflect.Message
func (*Credential) Reset ¶
func (x *Credential) Reset()
func (*Credential) String ¶
func (x *Credential) String() string
func (*Credential) Validate ¶
func (c *Credential) Validate(clientSecret string) error
type DescribeBy ¶
type DescribeBy int32
const ( // 通过service id查询应用详情 DescribeBy_SERVICE_ID DescribeBy = 0 // 通过service name查询应用详情 DescribeBy_SERVICE_NAME DescribeBy = 1 // 通过service client_id查询应用详情 DescribeBy_SERVICE_CLIENT_ID DescribeBy = 2 )
func ParseDescribeByFromString ¶
func ParseDescribeByFromString(str string) (DescribeBy, error)
ParseDescribeByFromString Parse DescribeBy from string
func (DescribeBy) Descriptor ¶
func (DescribeBy) Descriptor() protoreflect.EnumDescriptor
func (DescribeBy) Enum ¶
func (x DescribeBy) Enum() *DescribeBy
func (DescribeBy) EnumDescriptor
deprecated
func (DescribeBy) EnumDescriptor() ([]byte, []int)
Deprecated: Use DescribeBy.Descriptor instead.
func (DescribeBy) Number ¶
func (x DescribeBy) Number() protoreflect.EnumNumber
func (DescribeBy) String ¶
func (x DescribeBy) String() string
func (DescribeBy) Type ¶
func (DescribeBy) Type() protoreflect.EnumType
func (*DescribeBy) UnmarshalJSON ¶
func (t *DescribeBy) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type DescribeServiceRequest ¶
type DescribeServiceRequest struct { // 查询详情的方式 // @gotags: json:"describe_by" yaml:"describe_by" DescribeBy DescribeBy `` /* 146-byte string literal not displayed */ // 服务客户端Id // @gotags: json:"client_id" yaml:"client_id" ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id" yaml:"client_id"` // 服务名称 // @gotags: json:"name" yaml:"name" Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name" yaml:"name"` // 服务Id // @gotags: json:"id" yaml:"id" Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id" yaml:"id"` // contains filtered or unexported fields }
DescribeMicroRequest 查询应用详情
func NewDescribeServiceRequestByClientId ¶
func NewDescribeServiceRequestByClientId(clientId string) *DescribeServiceRequest
func (*DescribeServiceRequest) Descriptor
deprecated
func (*DescribeServiceRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeServiceRequest.ProtoReflect.Descriptor instead.
func (*DescribeServiceRequest) GetClientId ¶
func (x *DescribeServiceRequest) GetClientId() string
func (*DescribeServiceRequest) GetDescribeBy ¶
func (x *DescribeServiceRequest) GetDescribeBy() DescribeBy
func (*DescribeServiceRequest) GetId ¶
func (x *DescribeServiceRequest) GetId() string
func (*DescribeServiceRequest) GetName ¶
func (x *DescribeServiceRequest) GetName() string
func (*DescribeServiceRequest) ProtoMessage ¶
func (*DescribeServiceRequest) ProtoMessage()
func (*DescribeServiceRequest) ProtoReflect ¶
func (x *DescribeServiceRequest) ProtoReflect() protoreflect.Message
func (*DescribeServiceRequest) Reset ¶
func (x *DescribeServiceRequest) Reset()
func (*DescribeServiceRequest) String ¶
func (x *DescribeServiceRequest) String() string
type LANGUAGE ¶
type LANGUAGE int32
const ( LANGUAGE_JAVA LANGUAGE = 0 LANGUAGE_JAVASCRIPT LANGUAGE = 1 LANGUAGE_GOLANG LANGUAGE = 2 LANGUAGE_PYTHON LANGUAGE = 3 LANGUAGE_PHP LANGUAGE = 4 LANGUAGE_C_SHARP LANGUAGE = 5 LANGUAGE_C LANGUAGE = 6 LANGUAGE_C_PLUS_PLUS LANGUAGE = 7 LANGUAGE_SWIFT LANGUAGE = 8 LANGUAGE_OBJECT_C LANGUAGE = 9 LANGUAGE_RUST LANGUAGE = 10 LANGUAGE_RUBY LANGUAGE = 11 LANGUAGE_DART LANGUAGE = 12 LANGUAGE_KOTLIN LANGUAGE = 13 LANGUAGE_SHELL LANGUAGE = 14 LANGUAGE_POWER_SHELL LANGUAGE = 15 )
func ParseLANGUAGEFromString ¶
ParseLANGUAGEFromString Parse LANGUAGE from string
func (LANGUAGE) Descriptor ¶
func (LANGUAGE) Descriptor() protoreflect.EnumDescriptor
func (LANGUAGE) EnumDescriptor
deprecated
func (LANGUAGE) Number ¶
func (x LANGUAGE) Number() protoreflect.EnumNumber
func (LANGUAGE) Type ¶
func (LANGUAGE) Type() protoreflect.EnumType
func (*LANGUAGE) UnmarshalJSON ¶
UnmarshalJSON todo
type MetaService ¶
type RPCClient ¶
type RPCClient interface { ValidateCredential(ctx context.Context, in *ValidateCredentialRequest, opts ...grpc.CallOption) (*Service, error) DescribeService(ctx context.Context, in *DescribeServiceRequest, opts ...grpc.CallOption) (*Service, 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 { ValidateCredential(context.Context, *ValidateCredentialRequest) (*Service, error) DescribeService(context.Context, *DescribeServiceRequest) (*Service, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type Repository ¶
type Repository struct { // 仓库提供商 // @gotags: bson:"provider" json:"provider" Provider SCM_PROVIDER `protobuf:"varint,1,opt,name=provider,proto3,enum=go8.devcloud.mcenter.service.SCM_PROVIDER" json:"provider" bson:"provider"` // token 操作仓库, 比如设置回调 // @gotags: bson:"token" json:"token" Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" bson:"token"` // 仓库对应的项目Id // @gotags: bson:"project_id" json:"project_id" ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id" bson:"project_id"` // 仓库ssh url地址 // @gotags: bson:"ssh_url" json:"ssh_url" SshUrl string `protobuf:"bytes,4,opt,name=ssh_url,json=sshUrl,proto3" json:"ssh_url" bson:"ssh_url"` // 仓库http url地址 // @gotags: bson:"http_url" json:"http_url" HttpUrl string `protobuf:"bytes,5,opt,name=http_url,json=httpUrl,proto3" json:"http_url" bson:"http_url"` // 源代码使用的编程语言, 构建时, 不同语言有不同的构建环境 // @gotags: bson:"language" json:"language" Language LANGUAGE `protobuf:"varint,6,opt,name=language,proto3,enum=go8.devcloud.mcenter.service.LANGUAGE" json:"language" bson:"language"` // scm设置Hook后返回的id, 用于删除应用时,取消hook使用 // @gotags: bson:"hook_id" json:"hook_id" HookId string `protobuf:"bytes,7,opt,name=hook_id,json=hookId,proto3" json:"hook_id" bson:"hook_id"` // 创建hook过程中的错误信息 // @gotags: bson:"hook_error" json:"hook_error" HookError string `protobuf:"bytes,8,opt,name=hook_error,json=hookError,proto3" json:"hook_error" bson:"hook_error"` // contains filtered or unexported fields }
服务仓库信息
func (*Repository) Descriptor
deprecated
func (*Repository) Descriptor() ([]byte, []int)
Deprecated: Use Repository.ProtoReflect.Descriptor instead.
func (*Repository) GetHookError ¶
func (x *Repository) GetHookError() string
func (*Repository) GetHookId ¶
func (x *Repository) GetHookId() string
func (*Repository) GetHttpUrl ¶
func (x *Repository) GetHttpUrl() string
func (*Repository) GetLanguage ¶
func (x *Repository) GetLanguage() LANGUAGE
func (*Repository) GetProjectId ¶
func (x *Repository) GetProjectId() string
func (*Repository) GetProvider ¶
func (x *Repository) GetProvider() SCM_PROVIDER
func (*Repository) GetSshUrl ¶
func (x *Repository) GetSshUrl() string
func (*Repository) GetToken ¶
func (x *Repository) GetToken() string
func (*Repository) ProtoMessage ¶
func (*Repository) ProtoMessage()
func (*Repository) ProtoReflect ¶
func (x *Repository) ProtoReflect() protoreflect.Message
func (*Repository) Reset ¶
func (x *Repository) Reset()
func (*Repository) String ¶
func (x *Repository) String() string
type SCM_PROVIDER ¶
type SCM_PROVIDER int32
SCM_TYPE 源码仓库类型
const ( // gitlab SCM_PROVIDER_GITLAB SCM_PROVIDER = 0 // github SCM_PROVIDER_GITHUB SCM_PROVIDER = 1 // coding.net SCM_PROVIDER_CODING SCM_PROVIDER = 2 )
func ParseSCM_PROVIDERFromString ¶
func ParseSCM_PROVIDERFromString(str string) (SCM_PROVIDER, error)
ParseSCM_PROVIDERFromString Parse SCM_PROVIDER from string
func (SCM_PROVIDER) Descriptor ¶
func (SCM_PROVIDER) Descriptor() protoreflect.EnumDescriptor
func (SCM_PROVIDER) Enum ¶
func (x SCM_PROVIDER) Enum() *SCM_PROVIDER
func (SCM_PROVIDER) EnumDescriptor
deprecated
func (SCM_PROVIDER) EnumDescriptor() ([]byte, []int)
Deprecated: Use SCM_PROVIDER.Descriptor instead.
func (SCM_PROVIDER) Equal ¶
func (t SCM_PROVIDER) Equal(target SCM_PROVIDER) bool
Equal type compare
func (SCM_PROVIDER) MarshalJSON ¶
func (t SCM_PROVIDER) MarshalJSON() ([]byte, error)
MarshalJSON todo
func (SCM_PROVIDER) Number ¶
func (x SCM_PROVIDER) Number() protoreflect.EnumNumber
func (SCM_PROVIDER) String ¶
func (x SCM_PROVIDER) String() string
func (SCM_PROVIDER) Type ¶
func (SCM_PROVIDER) Type() protoreflect.EnumType
func (*SCM_PROVIDER) UnmarshalJSON ¶
func (t *SCM_PROVIDER) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type Security ¶
type Security struct { // 用于加密应用的铭感信息的key // @gotags: bson:"encrypt_key" json:"encrypt_key" EncryptKey string `protobuf:"bytes,1,opt,name=encrypt_key,json=encryptKey,proto3" json:"encrypt_key" bson:"encrypt_key"` // contains filtered or unexported fields }
服务安全相关信息
func NewRandomSecurity ¶
func NewRandomSecurity() *Security
func (*Security) Descriptor
deprecated
func (*Security) GetEncryptKey ¶
func (*Security) ProtoMessage ¶
func (*Security) ProtoMessage()
func (*Security) ProtoReflect ¶
func (x *Security) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct { // 微服务ID // @gotags: bson:"_id" json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 创建的时间 // @gotags: bson:"create_at" json:"create_at" CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"` // 更新时间 // @gotags: bson:"update_at" json:"update_at" UpdateAt int64 `protobuf:"varint,5,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"` // 更新人 // @gotags: bson:"update_by" json:"update_by" UpdateBy string `protobuf:"bytes,6,opt,name=update_by,json=updateBy,proto3" json:"update_by" bson:"update_by"` // 服务定义 // @gotags: bson:"spec" json:"spec" Spec *CreateServiceRequest `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec" bson:"spec"` // 服务的凭证, 用于服务注册 // @gotags: bson:"credential" json:"credential" Credential *Credential `protobuf:"bytes,8,opt,name=credential,proto3" json:"credential" bson:"credential"` // 服务安全所需配置 // @gotags: bson:"security" json:"security" Security *Security `protobuf:"bytes,9,opt,name=security,proto3" json:"security" bson:"security"` // contains filtered or unexported fields }
Service is service provider 整个平台提供的服务 都是叫做服务 平台的系统服务: mcenter/cmdb/maudit/sms..... 用户服务: 开发者自己开发,入驻到平台的服务, 电商, 库存管理,商品管理,订单,支付,....
func NewDefaultService ¶
func NewDefaultService() *Service
func NewService ¶
func NewService(req *CreateServiceRequest) (*Service, error)
func (*Service) Descriptor
deprecated
func (*Service) FullNameHash ¶
func (*Service) GetCreateAt ¶
func (*Service) GetCredential ¶
func (x *Service) GetCredential() *Credential
func (*Service) GetSecurity ¶
func (*Service) GetSpec ¶
func (x *Service) GetSpec() *CreateServiceRequest
func (*Service) GetUpdateAt ¶
func (*Service) GetUpdateBy ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ProtoReflect ¶
func (x *Service) ProtoReflect() protoreflect.Message
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 UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) DescribeService ¶
func (UnimplementedRPCServer) DescribeService(context.Context, *DescribeServiceRequest) (*Service, error)
func (UnimplementedRPCServer) ValidateCredential ¶
func (UnimplementedRPCServer) ValidateCredential(context.Context, *ValidateCredentialRequest) (*Service, 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 ValidateCredentialRequest ¶
type ValidateCredentialRequest struct { // 服务客户端ID // @gotags: json:"client_id" yaml:"client_id" validate:"required,lte=100" ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id" yaml:"client_id" validate:"required,lte=100"` // 服务客户端凭证 // @gotags: json:"client_secret" yaml:"client_secret" validate:"required,lte=100" ClientSecret string `` /* 136-byte string literal not displayed */ // contains filtered or unexported fields }
ValidateCredentialRequest 校验服务凭证
func NewValidateCredentialRequest ¶
func NewValidateCredentialRequest(clientId, clientSercet string) *ValidateCredentialRequest
func (*ValidateCredentialRequest) Descriptor
deprecated
func (*ValidateCredentialRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateCredentialRequest.ProtoReflect.Descriptor instead.
func (*ValidateCredentialRequest) GetClientId ¶
func (x *ValidateCredentialRequest) GetClientId() string
func (*ValidateCredentialRequest) GetClientSecret ¶
func (x *ValidateCredentialRequest) GetClientSecret() string
func (*ValidateCredentialRequest) ProtoMessage ¶
func (*ValidateCredentialRequest) ProtoMessage()
func (*ValidateCredentialRequest) ProtoReflect ¶
func (x *ValidateCredentialRequest) ProtoReflect() protoreflect.Message
func (*ValidateCredentialRequest) Reset ¶
func (x *ValidateCredentialRequest) Reset()
func (*ValidateCredentialRequest) String ¶
func (x *ValidateCredentialRequest) String() string