Documentation ¶
Index ¶
- Constants
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterMicroServiceServer(s grpc.ServiceRegistrar, srv MicroServiceServer)
- type CreateMicroRequest
- func (*CreateMicroRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateMicroRequest) GetCreater() string
- func (x *CreateMicroRequest) GetDescription() string
- func (x *CreateMicroRequest) GetDomain() string
- func (x *CreateMicroRequest) GetLabel() map[string]string
- func (x *CreateMicroRequest) GetName() string
- func (x *CreateMicroRequest) GetType() Type
- func (*CreateMicroRequest) ProtoMessage()
- func (x *CreateMicroRequest) ProtoReflect() protoreflect.Message
- func (x *CreateMicroRequest) Reset()
- func (x *CreateMicroRequest) String() string
- func (req *CreateMicroRequest) Validate() error
- type DeleteMicroRequest
- func (*DeleteMicroRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteMicroRequest) GetId() string
- func (*DeleteMicroRequest) ProtoMessage()
- func (x *DeleteMicroRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteMicroRequest) Reset()
- func (x *DeleteMicroRequest) String() string
- func (req *DeleteMicroRequest) Validate() error
- type DescribeMicroRequest
- func (*DescribeMicroRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeMicroRequest) GetClientId() string
- func (x *DescribeMicroRequest) GetId() string
- func (x *DescribeMicroRequest) GetName() string
- func (*DescribeMicroRequest) ProtoMessage()
- func (x *DescribeMicroRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeMicroRequest) Reset()
- func (x *DescribeMicroRequest) String() string
- func (req *DescribeMicroRequest) Validate() error
- type Micro
- func (*Micro) Descriptor() ([]byte, []int)deprecated
- func (m *Micro) Desensitize()
- func (x *Micro) GetAccount() string
- func (x *Micro) GetClientEnabled() bool
- func (x *Micro) GetClientId() string
- func (x *Micro) GetClientRefreshAt() int64
- func (x *Micro) GetClientSecret() string
- func (x *Micro) GetCreateAt() int64
- func (x *Micro) GetCreater() string
- func (x *Micro) GetDescription() string
- func (x *Micro) GetDomain() string
- func (x *Micro) GetEnabled() bool
- func (x *Micro) GetId() string
- func (x *Micro) GetLabel() map[string]string
- func (x *Micro) GetName() string
- func (x *Micro) GetType() Type
- func (x *Micro) GetUpdateAt() int64
- func (*Micro) ProtoMessage()
- func (x *Micro) ProtoReflect() protoreflect.Message
- func (x *Micro) Reset()
- func (x *Micro) String() string
- func (m *Micro) ValiateClientCredential(clientSecret string) error
- type MicroServiceClient
- type MicroServiceServer
- type QueryMicroRequest
- func (*QueryMicroRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryMicroRequest) GetPage() *page.PageRequest
- func (x *QueryMicroRequest) GetType() Type
- func (*QueryMicroRequest) ProtoMessage()
- func (x *QueryMicroRequest) ProtoReflect() protoreflect.Message
- func (x *QueryMicroRequest) Reset()
- func (x *QueryMicroRequest) String() string
- type Set
- 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 UnimplementedMicroServiceServer
- func (UnimplementedMicroServiceServer) CreateService(context.Context, *CreateMicroRequest) (*Micro, error)
- func (UnimplementedMicroServiceServer) DeleteService(context.Context, *DeleteMicroRequest) (*Micro, error)
- func (UnimplementedMicroServiceServer) DescribeService(context.Context, *DescribeMicroRequest) (*Micro, error)
- func (UnimplementedMicroServiceServer) QueryService(context.Context, *QueryMicroRequest) (*Set, error)
- func (UnimplementedMicroServiceServer) RefreshServiceClientSecret(context.Context, *DescribeMicroRequest) (*Micro, error)
- func (UnimplementedMicroServiceServer) ValidateClientCredential(context.Context, *ValidateClientCredentialRequest) (*Micro, error)
- type UnsafeMicroServiceServer
- type ValidateClientCredentialRequest
- func (*ValidateClientCredentialRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateClientCredentialRequest) GetClientId() string
- func (x *ValidateClientCredentialRequest) GetClientSecret() string
- func (*ValidateClientCredentialRequest) ProtoMessage()
- func (x *ValidateClientCredentialRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateClientCredentialRequest) Reset()
- func (x *ValidateClientCredentialRequest) String() string
Constants ¶
const (
AppName = "micro"
)
Variables ¶
var ( Type_name = map[int32]string{ 0: "NULL", 1: "CUSTOM", 2: "BUILD_IN", } Type_value = map[string]int32{ "NULL": 0, "CUSTOM": 1, "BUILD_IN": 2, } )
Enum value maps for Type.
var File_app_micro_pb_enum_proto protoreflect.FileDescriptor
var File_app_micro_pb_micro_proto protoreflect.FileDescriptor
var File_app_micro_pb_request_proto protoreflect.FileDescriptor
var File_app_micro_pb_service_proto protoreflect.FileDescriptor
var MicroService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.keyauth.micro.MicroService", HandlerType: (*MicroServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ValidateClientCredential", Handler: _MicroService_ValidateClientCredential_Handler, }, { MethodName: "CreateService", Handler: _MicroService_CreateService_Handler, }, { MethodName: "QueryService", Handler: _MicroService_QueryService_Handler, }, { MethodName: "DescribeService", Handler: _MicroService_DescribeService_Handler, }, { MethodName: "DeleteService", Handler: _MicroService_DeleteService_Handler, }, { MethodName: "RefreshServiceClientSecret", Handler: _MicroService_RefreshServiceClientSecret_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "app/micro/pb/service.proto", }
MicroService_ServiceDesc is the grpc.ServiceDesc for MicroService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMicroServiceServer ¶
func RegisterMicroServiceServer(s grpc.ServiceRegistrar, srv MicroServiceServer)
Types ¶
type CreateMicroRequest ¶
type CreateMicroRequest struct { // 服务类型 // @gotags: bson:"type" json:"type" Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=infraboard.keyauth.micro.Type" json:"type" bson:"type"` // 名称 // @gotags: bson:"name" json:"name" validate:"required,lte=200" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" bson:"name" validate:"required,lte=200"` // 服务标签 // @gotags: bson:"label" json:"label" validate:"lte=80" Label map[string]string `` /* 172-byte string literal not displayed */ // 描述信息 // @gotags: bson:"description" json:"description,omitempty" Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" bson:"description"` // 服务所属域 // @gotags: bson:"domain" json:"domain" Domain string `protobuf:"bytes,5,opt,name=domain,proto3" json:"domain" bson:"domain"` // 创建者ID // @gotags: bson:"creater" json:"creater" Creater string `protobuf:"bytes,6,opt,name=creater,proto3" json:"creater" bson:"creater"` // contains filtered or unexported fields }
CreateMicroRequest 服务创建请求
func NewCreateMicroRequest ¶
func NewCreateMicroRequest() *CreateMicroRequest
NewCreateMicroRequest todo
func (*CreateMicroRequest) Descriptor
deprecated
func (*CreateMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateMicroRequest.ProtoReflect.Descriptor instead.
func (*CreateMicroRequest) GetCreater ¶
func (x *CreateMicroRequest) GetCreater() string
func (*CreateMicroRequest) GetDescription ¶
func (x *CreateMicroRequest) GetDescription() string
func (*CreateMicroRequest) GetDomain ¶
func (x *CreateMicroRequest) GetDomain() string
func (*CreateMicroRequest) GetLabel ¶
func (x *CreateMicroRequest) GetLabel() map[string]string
func (*CreateMicroRequest) GetName ¶
func (x *CreateMicroRequest) GetName() string
func (*CreateMicroRequest) GetType ¶
func (x *CreateMicroRequest) GetType() Type
func (*CreateMicroRequest) ProtoMessage ¶
func (*CreateMicroRequest) ProtoMessage()
func (*CreateMicroRequest) ProtoReflect ¶
func (x *CreateMicroRequest) ProtoReflect() protoreflect.Message
func (*CreateMicroRequest) Reset ¶
func (x *CreateMicroRequest) Reset()
func (*CreateMicroRequest) String ¶
func (x *CreateMicroRequest) String() string
func (*CreateMicroRequest) Validate ¶
func (req *CreateMicroRequest) Validate() error
Validate 校验请求是否合法
type DeleteMicroRequest ¶
type DeleteMicroRequest struct { // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
DeleteMicroRequest todo
func NewDeleteMicroRequestWithID ¶
func NewDeleteMicroRequestWithID(id string) *DeleteMicroRequest
NewDeleteMicroRequestWithID todo
func (*DeleteMicroRequest) Descriptor
deprecated
func (*DeleteMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteMicroRequest.ProtoReflect.Descriptor instead.
func (*DeleteMicroRequest) GetId ¶
func (x *DeleteMicroRequest) GetId() string
func (*DeleteMicroRequest) ProtoMessage ¶
func (*DeleteMicroRequest) ProtoMessage()
func (*DeleteMicroRequest) ProtoReflect ¶
func (x *DeleteMicroRequest) ProtoReflect() protoreflect.Message
func (*DeleteMicroRequest) Reset ¶
func (x *DeleteMicroRequest) Reset()
func (*DeleteMicroRequest) String ¶
func (x *DeleteMicroRequest) String() string
type DescribeMicroRequest ¶
type DescribeMicroRequest struct { // @gotags: json:"client_id" ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id"` // @gotags: json:"name" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` // @gotags: json:"id" Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
DescribeMicroRequest 查询应用详情
func NewDescribeServiceRequest ¶
func NewDescribeServiceRequest() *DescribeMicroRequest
NewDescribeServiceRequest new实例
func NewDescribeServiceRequestWithClientID ¶
func NewDescribeServiceRequestWithClientID(clientID string) *DescribeMicroRequest
NewDescribeServiceRequestWithClientID new实例
func (*DescribeMicroRequest) Descriptor
deprecated
func (*DescribeMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeMicroRequest.ProtoReflect.Descriptor instead.
func (*DescribeMicroRequest) GetClientId ¶
func (x *DescribeMicroRequest) GetClientId() string
func (*DescribeMicroRequest) GetId ¶
func (x *DescribeMicroRequest) GetId() string
func (*DescribeMicroRequest) GetName ¶
func (x *DescribeMicroRequest) GetName() string
func (*DescribeMicroRequest) ProtoMessage ¶
func (*DescribeMicroRequest) ProtoMessage()
func (*DescribeMicroRequest) ProtoReflect ¶
func (x *DescribeMicroRequest) ProtoReflect() protoreflect.Message
func (*DescribeMicroRequest) Reset ¶
func (x *DescribeMicroRequest) Reset()
func (*DescribeMicroRequest) String ¶
func (x *DescribeMicroRequest) String() string
func (*DescribeMicroRequest) Validate ¶
func (req *DescribeMicroRequest) Validate() error
Validate 校验详情查询请求
type Micro ¶
type Micro struct { // 微服务ID // @gotags: bson:"_id" json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 服务所属域 // @gotags: bson:"domain" json:"domain" Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" bson:"domain"` // 创建人 // @gotags: bson:"creater" json:"creater" Creater string `protobuf:"bytes,3,opt,name=creater,proto3" json:"creater" bson:"creater"` // 创建的时间 // @gotags: bson:"create_at" json:"create_at,omitempty" CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` // 更新时间 // @gotags: bson:"update_at" json:"update_at,omitempty" UpdateAt int64 `protobuf:"varint,5,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty" bson:"update_at"` // 服务账号 // @gotags: bson:"account" json:"account" Account string `protobuf:"bytes,6,opt,name=account,proto3" json:"account" bson:"account"` // 服务客户端ID // @gotags: bson:"client_id" json:"client_id" ClientId string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id" bson:"client_id"` // 服务客户端凭证 // @gotags: bson:"client_secret" json:"client_secret" ClientSecret string `protobuf:"bytes,8,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret" bson:"client_secret"` // 是否启动客户端 // @gotags: bson:"client_enabled" json:"client_enabled" ClientEnabled bool `protobuf:"varint,9,opt,name=client_enabled,json=clientEnabled,proto3" json:"client_enabled" bson:"client_enabled"` // 客户端刷新时间 // @gotags: bson:"client_refresh_at" json:"client_refresh_at" ClientRefreshAt int64 `protobuf:"varint,10,opt,name=client_refresh_at,json=clientRefreshAt,proto3" json:"client_refresh_at" bson:"client_refresh_at"` // 是否启用该服务 // @gotags: bson:"enabled" json:"enabled" Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled" bson:"enabled"` // 服务类型 // @gotags: bson:"type" json:"type" Type Type `protobuf:"varint,12,opt,name=type,proto3,enum=infraboard.keyauth.micro.Type" json:"type" bson:"type"` // 名称 // @gotags: bson:"name" json:"name" Name string `protobuf:"bytes,13,opt,name=name,proto3" json:"name" bson:"name"` // 服务标签 // @gotags: bson:"label" json:"label" Label map[string]string `` /* 155-byte string literal not displayed */ // 描述信息 // @gotags: bson:"description" json:"description,omitempty" Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty" bson:"description"` // contains filtered or unexported fields }
Micro is service provider
func (*Micro) Descriptor
deprecated
func (*Micro) GetAccount ¶
func (*Micro) GetClientEnabled ¶
func (*Micro) GetClientId ¶
func (*Micro) GetClientRefreshAt ¶
func (*Micro) GetClientSecret ¶
func (*Micro) GetCreateAt ¶
func (*Micro) GetCreater ¶
func (*Micro) GetDescription ¶
func (*Micro) GetEnabled ¶
func (*Micro) GetUpdateAt ¶
func (*Micro) ProtoMessage ¶
func (*Micro) ProtoMessage()
func (*Micro) ProtoReflect ¶
func (x *Micro) ProtoReflect() protoreflect.Message
func (*Micro) ValiateClientCredential ¶
ValiateClientCredential todo
type MicroServiceClient ¶
type MicroServiceClient interface { ValidateClientCredential(ctx context.Context, in *ValidateClientCredentialRequest, opts ...grpc.CallOption) (*Micro, error) CreateService(ctx context.Context, in *CreateMicroRequest, opts ...grpc.CallOption) (*Micro, error) QueryService(ctx context.Context, in *QueryMicroRequest, opts ...grpc.CallOption) (*Set, error) DescribeService(ctx context.Context, in *DescribeMicroRequest, opts ...grpc.CallOption) (*Micro, error) DeleteService(ctx context.Context, in *DeleteMicroRequest, opts ...grpc.CallOption) (*Micro, error) RefreshServiceClientSecret(ctx context.Context, in *DescribeMicroRequest, opts ...grpc.CallOption) (*Micro, error) }
MicroServiceClient is the client API for MicroService 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 NewMicroServiceClient ¶
func NewMicroServiceClient(cc grpc.ClientConnInterface) MicroServiceClient
type MicroServiceServer ¶
type MicroServiceServer interface { ValidateClientCredential(context.Context, *ValidateClientCredentialRequest) (*Micro, error) CreateService(context.Context, *CreateMicroRequest) (*Micro, error) QueryService(context.Context, *QueryMicroRequest) (*Set, error) DescribeService(context.Context, *DescribeMicroRequest) (*Micro, error) DeleteService(context.Context, *DeleteMicroRequest) (*Micro, error) RefreshServiceClientSecret(context.Context, *DescribeMicroRequest) (*Micro, error) // contains filtered or unexported methods }
MicroServiceServer is the server API for MicroService service. All implementations must embed UnimplementedMicroServiceServer for forward compatibility
type QueryMicroRequest ¶
type QueryMicroRequest struct { // @gotags: json:"page" Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 服务类型 // @gotags: json:"type" Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=infraboard.keyauth.micro.Type" json:"type"` // contains filtered or unexported fields }
QueryMicroRequest 查询应用列表
func NewQueryMicroRequest ¶
func NewQueryMicroRequest(pageReq *request.PageRequest) *QueryMicroRequest
NewQueryMicroRequest 列表查询请求
func (*QueryMicroRequest) Descriptor
deprecated
func (*QueryMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryMicroRequest.ProtoReflect.Descriptor instead.
func (*QueryMicroRequest) GetPage ¶
func (x *QueryMicroRequest) GetPage() *page.PageRequest
func (*QueryMicroRequest) GetType ¶
func (x *QueryMicroRequest) GetType() Type
func (*QueryMicroRequest) ProtoMessage ¶
func (*QueryMicroRequest) ProtoMessage()
func (*QueryMicroRequest) ProtoReflect ¶
func (x *QueryMicroRequest) ProtoReflect() protoreflect.Message
func (*QueryMicroRequest) Reset ¶
func (x *QueryMicroRequest) Reset()
func (*QueryMicroRequest) String ¶
func (x *QueryMicroRequest) String() string
type Set ¶
type Set struct { // @gotags: bson:"total" json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` // @gotags: bson:"items" json:"items" Items []*Micro `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) 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 UnimplementedMicroServiceServer ¶
type UnimplementedMicroServiceServer struct { }
UnimplementedMicroServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedMicroServiceServer) CreateService ¶
func (UnimplementedMicroServiceServer) CreateService(context.Context, *CreateMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) DeleteService ¶
func (UnimplementedMicroServiceServer) DeleteService(context.Context, *DeleteMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) DescribeService ¶
func (UnimplementedMicroServiceServer) DescribeService(context.Context, *DescribeMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) QueryService ¶
func (UnimplementedMicroServiceServer) QueryService(context.Context, *QueryMicroRequest) (*Set, error)
func (UnimplementedMicroServiceServer) RefreshServiceClientSecret ¶
func (UnimplementedMicroServiceServer) RefreshServiceClientSecret(context.Context, *DescribeMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) ValidateClientCredential ¶
func (UnimplementedMicroServiceServer) ValidateClientCredential(context.Context, *ValidateClientCredentialRequest) (*Micro, error)
type UnsafeMicroServiceServer ¶
type UnsafeMicroServiceServer interface {
// contains filtered or unexported methods
}
UnsafeMicroServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MicroServiceServer will result in compilation errors.
type ValidateClientCredentialRequest ¶
type ValidateClientCredentialRequest struct { // 服务客户端ID // @gotags: json:"client_id" validate:"required,lte=100" ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id" validate:"required,lte=100"` // 服务客户端凭证 // @gotags: json:"client_secret" validate:"required,lte=100" ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret" validate:"required,lte=100"` // contains filtered or unexported fields }
ValidateClientCredentialRequest 校验服务凭证
func NewValidateClientCredentialRequest ¶
func NewValidateClientCredentialRequest(clientID, clientSecret string) *ValidateClientCredentialRequest
NewValidateClientCredentialRequest todo
func (*ValidateClientCredentialRequest) Descriptor
deprecated
func (*ValidateClientCredentialRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateClientCredentialRequest.ProtoReflect.Descriptor instead.
func (*ValidateClientCredentialRequest) GetClientId ¶
func (x *ValidateClientCredentialRequest) GetClientId() string
func (*ValidateClientCredentialRequest) GetClientSecret ¶
func (x *ValidateClientCredentialRequest) GetClientSecret() string
func (*ValidateClientCredentialRequest) ProtoMessage ¶
func (*ValidateClientCredentialRequest) ProtoMessage()
func (*ValidateClientCredentialRequest) ProtoReflect ¶
func (x *ValidateClientCredentialRequest) ProtoReflect() protoreflect.Message
func (*ValidateClientCredentialRequest) Reset ¶
func (x *ValidateClientCredentialRequest) Reset()
func (*ValidateClientCredentialRequest) String ¶
func (x *ValidateClientCredentialRequest) String() string