Documentation ¶
Index ¶
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterMicroServiceServer(s grpc.ServiceRegistrar, srv MicroServiceServer)
- type CreateMicroRequest
- func (*CreateMicroRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateMicroRequest) GetDescription() 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 ¶
This section is empty.
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_pkg_micro_pb_enum_proto protoreflect.FileDescriptor
var File_pkg_micro_pb_micro_proto protoreflect.FileDescriptor
var File_pkg_micro_pb_request_proto protoreflect.FileDescriptor
var File_pkg_micro_pb_service_proto protoreflect.FileDescriptor
var MicroService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "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: "pkg/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 ¶ added in v0.2.0
func RegisterMicroServiceServer(s grpc.ServiceRegistrar, srv MicroServiceServer)
Types ¶
type CreateMicroRequest ¶
type CreateMicroRequest struct { // 服务类型 Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=keyauth.micro.Type" json:"type" bson:"type"` // 名称 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" bson:"name" validate:"required,lte=200"` // 服务标签 Label map[string]string `` /* 172-byte string literal not displayed */ // 描述信息 Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" bson:"description"` // contains filtered or unexported fields }
CreateMicroRequest 服务创建请求
func NewCreateMicroRequest ¶
func NewCreateMicroRequest() *CreateMicroRequest
NewCreateMicroRequest todo
func (*CreateMicroRequest) Descriptor
deprecated
added in
v0.2.0
func (*CreateMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateMicroRequest.ProtoReflect.Descriptor instead.
func (*CreateMicroRequest) GetDescription ¶ added in v0.2.0
func (x *CreateMicroRequest) GetDescription() string
func (*CreateMicroRequest) GetLabel ¶ added in v0.2.0
func (x *CreateMicroRequest) GetLabel() map[string]string
func (*CreateMicroRequest) GetName ¶ added in v0.2.0
func (x *CreateMicroRequest) GetName() string
func (*CreateMicroRequest) GetType ¶ added in v0.2.0
func (x *CreateMicroRequest) GetType() Type
func (*CreateMicroRequest) ProtoMessage ¶ added in v0.2.0
func (*CreateMicroRequest) ProtoMessage()
func (*CreateMicroRequest) ProtoReflect ¶ added in v0.2.0
func (x *CreateMicroRequest) ProtoReflect() protoreflect.Message
func (*CreateMicroRequest) Reset ¶ added in v0.2.0
func (x *CreateMicroRequest) Reset()
func (*CreateMicroRequest) String ¶ added in v0.2.0
func (x *CreateMicroRequest) String() string
func (*CreateMicroRequest) Validate ¶
func (req *CreateMicroRequest) Validate() error
Validate 校验请求是否合法
type DeleteMicroRequest ¶ added in v0.2.0
type DeleteMicroRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
DeleteMicroRequest todo
func NewDeleteMicroRequestWithID ¶ added in v0.2.0
func NewDeleteMicroRequestWithID(id string) *DeleteMicroRequest
NewDeleteMicroRequestWithID todo
func (*DeleteMicroRequest) Descriptor
deprecated
added in
v0.2.0
func (*DeleteMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteMicroRequest.ProtoReflect.Descriptor instead.
func (*DeleteMicroRequest) GetId ¶ added in v0.2.0
func (x *DeleteMicroRequest) GetId() string
func (*DeleteMicroRequest) ProtoMessage ¶ added in v0.2.0
func (*DeleteMicroRequest) ProtoMessage()
func (*DeleteMicroRequest) ProtoReflect ¶ added in v0.2.0
func (x *DeleteMicroRequest) ProtoReflect() protoreflect.Message
func (*DeleteMicroRequest) Reset ¶ added in v0.2.0
func (x *DeleteMicroRequest) Reset()
func (*DeleteMicroRequest) String ¶ added in v0.2.0
func (x *DeleteMicroRequest) String() string
func (*DeleteMicroRequest) Validate ¶ added in v0.2.0
func (req *DeleteMicroRequest) Validate() error
Validate todo
type DescribeMicroRequest ¶
type DescribeMicroRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
DescribeMicroRequest 查询应用详情
func NewDescribeServiceRequest ¶ added in v0.2.0
func NewDescribeServiceRequest() *DescribeMicroRequest
NewDescribeServiceRequest new实例
func NewDescribeServiceRequestWithClientID ¶ added in v0.2.0
func NewDescribeServiceRequestWithClientID(clientID string) *DescribeMicroRequest
NewDescribeServiceRequestWithClientID new实例
func (*DescribeMicroRequest) Descriptor
deprecated
added in
v0.2.0
func (*DescribeMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeMicroRequest.ProtoReflect.Descriptor instead.
func (*DescribeMicroRequest) GetClientId ¶ added in v0.2.0
func (x *DescribeMicroRequest) GetClientId() string
func (*DescribeMicroRequest) GetId ¶ added in v0.2.0
func (x *DescribeMicroRequest) GetId() string
func (*DescribeMicroRequest) GetName ¶ added in v0.2.0
func (x *DescribeMicroRequest) GetName() string
func (*DescribeMicroRequest) ProtoMessage ¶ added in v0.2.0
func (*DescribeMicroRequest) ProtoMessage()
func (*DescribeMicroRequest) ProtoReflect ¶ added in v0.2.0
func (x *DescribeMicroRequest) ProtoReflect() protoreflect.Message
func (*DescribeMicroRequest) Reset ¶ added in v0.2.0
func (x *DescribeMicroRequest) Reset()
func (*DescribeMicroRequest) String ¶ added in v0.2.0
func (x *DescribeMicroRequest) String() string
func (*DescribeMicroRequest) Validate ¶
func (req *DescribeMicroRequest) Validate() error
Validate 校验详情查询请求
type Micro ¶
type Micro struct { // 微服务ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 服务所属域 Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" bson:"domain"` // 创建人 Creater string `protobuf:"bytes,3,opt,name=creater,proto3" json:"creater" bson:"creater"` // 创建的时间 CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` // 更新时间 UpdateAt int64 `protobuf:"varint,5,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty" bson:"update_at"` // 服务账号 Account string `protobuf:"bytes,6,opt,name=account,proto3" json:"account" bson:"account"` // 服务客户端ID ClientId string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id" bson:"client_id"` // 服务客户端凭证 ClientSecret string `protobuf:"bytes,8,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret" bson:"client_secret"` // 是否启动客户端 ClientEnabled bool `protobuf:"varint,9,opt,name=client_enabled,json=clientEnabled,proto3" json:"client_enabled" bson:"client_enabled"` // 客户端刷新时间 ClientRefreshAt int64 `protobuf:"varint,10,opt,name=client_refresh_at,json=clientRefreshAt,proto3" json:"client_refresh_at" bson:"client_refresh_at"` // 是否启用该服务 Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled" bson:"enabled"` // 服务类型 Type Type `protobuf:"varint,12,opt,name=type,proto3,enum=keyauth.micro.Type" json:"type" bson:"type"` // 名称 Name string `protobuf:"bytes,13,opt,name=name,proto3" json:"name" bson:"name"` // 服务标签 Label map[string]string `` /* 155-byte string literal not displayed */ // 描述信息 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
added in
v0.2.0
func (*Micro) GetAccount ¶ added in v0.2.0
func (*Micro) GetClientEnabled ¶ added in v0.2.0
func (*Micro) GetClientId ¶ added in v0.2.0
func (*Micro) GetClientRefreshAt ¶ added in v0.2.0
func (*Micro) GetClientSecret ¶ added in v0.2.0
func (*Micro) GetCreateAt ¶ added in v0.2.0
func (*Micro) GetCreater ¶ added in v0.2.0
func (*Micro) GetDescription ¶ added in v0.2.0
func (*Micro) GetEnabled ¶ added in v0.2.0
func (*Micro) GetUpdateAt ¶ added in v0.2.0
func (*Micro) ProtoMessage ¶ added in v0.2.0
func (*Micro) ProtoMessage()
func (*Micro) ProtoReflect ¶ added in v0.2.0
func (x *Micro) ProtoReflect() protoreflect.Message
func (*Micro) ValiateClientCredential ¶ added in v0.2.0
ValiateClientCredential todo
type MicroServiceClient ¶ added in v0.2.0
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 ¶ added in v0.2.0
func NewMicroServiceClient(cc grpc.ClientConnInterface) MicroServiceClient
type MicroServiceServer ¶ added in v0.2.0
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 { Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 服务类型 Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=keyauth.micro.Type" json:"type"` // contains filtered or unexported fields }
QueryMicroRequest 查询应用列表
func NewQueryMicroRequest ¶
func NewQueryMicroRequest(pageReq *request.PageRequest) *QueryMicroRequest
NewQueryMicroRequest 列表查询请求
func (*QueryMicroRequest) Descriptor
deprecated
added in
v0.2.0
func (*QueryMicroRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryMicroRequest.ProtoReflect.Descriptor instead.
func (*QueryMicroRequest) GetPage ¶ added in v0.2.0
func (x *QueryMicroRequest) GetPage() *page.PageRequest
func (*QueryMicroRequest) GetType ¶ added in v0.3.2
func (x *QueryMicroRequest) GetType() Type
func (*QueryMicroRequest) ProtoMessage ¶ added in v0.2.0
func (*QueryMicroRequest) ProtoMessage()
func (*QueryMicroRequest) ProtoReflect ¶ added in v0.2.0
func (x *QueryMicroRequest) ProtoReflect() protoreflect.Message
func (*QueryMicroRequest) Reset ¶ added in v0.2.0
func (x *QueryMicroRequest) Reset()
func (*QueryMicroRequest) String ¶ added in v0.2.0
func (x *QueryMicroRequest) String() string
type Set ¶
type Set struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` Items []*Micro `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
added in
v0.2.0
func (*Set) ProtoMessage ¶ added in v0.2.0
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶ added in v0.2.0
func (x *Set) ProtoReflect() protoreflect.Message
type Type ¶
type Type int32
func ParseTypeFromString ¶ added in v0.2.0
ParseTypeFromString Parse Type from string
func (Type) Descriptor ¶ added in v0.2.0
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
added in
v0.2.0
func (Type) MarshalJSON ¶ added in v0.2.0
MarshalJSON todo
func (Type) Number ¶ added in v0.2.0
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶ added in v0.2.0
func (Type) Type() protoreflect.EnumType
func (*Type) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON todo
type UnimplementedMicroServiceServer ¶ added in v0.2.0
type UnimplementedMicroServiceServer struct { }
UnimplementedMicroServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedMicroServiceServer) CreateService ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) CreateService(context.Context, *CreateMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) DeleteService ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) DeleteService(context.Context, *DeleteMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) DescribeService ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) DescribeService(context.Context, *DescribeMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) QueryService ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) QueryService(context.Context, *QueryMicroRequest) (*Set, error)
func (UnimplementedMicroServiceServer) RefreshServiceClientSecret ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) RefreshServiceClientSecret(context.Context, *DescribeMicroRequest) (*Micro, error)
func (UnimplementedMicroServiceServer) ValidateClientCredential ¶ added in v0.2.0
func (UnimplementedMicroServiceServer) ValidateClientCredential(context.Context, *ValidateClientCredentialRequest) (*Micro, error)
type UnsafeMicroServiceServer ¶ added in v0.2.0
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 ¶ added in v0.2.0
type ValidateClientCredentialRequest struct { // 服务客户端ID ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id" 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 ¶ added in v0.2.0
func NewValidateClientCredentialRequest(clientID, clientSecret string) *ValidateClientCredentialRequest
NewValidateClientCredentialRequest todo
func (*ValidateClientCredentialRequest) Descriptor
deprecated
added in
v0.2.0
func (*ValidateClientCredentialRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateClientCredentialRequest.ProtoReflect.Descriptor instead.
func (*ValidateClientCredentialRequest) GetClientId ¶ added in v0.2.0
func (x *ValidateClientCredentialRequest) GetClientId() string
func (*ValidateClientCredentialRequest) GetClientSecret ¶ added in v0.2.0
func (x *ValidateClientCredentialRequest) GetClientSecret() string
func (*ValidateClientCredentialRequest) ProtoMessage ¶ added in v0.2.0
func (*ValidateClientCredentialRequest) ProtoMessage()
func (*ValidateClientCredentialRequest) ProtoReflect ¶ added in v0.2.0
func (x *ValidateClientCredentialRequest) ProtoReflect() protoreflect.Message
func (*ValidateClientCredentialRequest) Reset ¶ added in v0.2.0
func (x *ValidateClientCredentialRequest) Reset()
func (*ValidateClientCredentialRequest) String ¶ added in v0.2.0
func (x *ValidateClientCredentialRequest) String() string