Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAuthzHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthzHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzClient) error
- func RegisterAuthzHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthzHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzServer) error
- func RegisterAuthzServer(s grpc.ServiceRegistrar, srv AuthzServer)
- type AuthzClient
- type AuthzServer
- type GetTokenRequest
- func (*GetTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTokenRequest) GetChallengeResponse() []byte
- func (x *GetTokenRequest) GetUsername() string
- func (*GetTokenRequest) ProtoMessage()
- func (x *GetTokenRequest) ProtoReflect() protoreflect.Message
- func (x *GetTokenRequest) Reset()
- func (x *GetTokenRequest) String() string
- func (m *GetTokenRequest) Validate() error
- func (m *GetTokenRequest) ValidateAll() error
- type GetTokenRequestMultiError
- type GetTokenRequestValidationError
- func (e GetTokenRequestValidationError) Cause() error
- func (e GetTokenRequestValidationError) Error() string
- func (e GetTokenRequestValidationError) ErrorName() string
- func (e GetTokenRequestValidationError) Field() string
- func (e GetTokenRequestValidationError) Key() bool
- func (e GetTokenRequestValidationError) Reason() string
- type GetTokenResponse
- func (*GetTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTokenResponse) GetExpiresOn() int64
- func (x *GetTokenResponse) GetToken() string
- func (*GetTokenResponse) ProtoMessage()
- func (x *GetTokenResponse) ProtoReflect() protoreflect.Message
- func (x *GetTokenResponse) Reset()
- func (x *GetTokenResponse) String() string
- func (m *GetTokenResponse) Validate() error
- func (m *GetTokenResponse) ValidateAll() error
- type GetTokenResponseMultiError
- type GetTokenResponseValidationError
- func (e GetTokenResponseValidationError) Cause() error
- func (e GetTokenResponseValidationError) Error() string
- func (e GetTokenResponseValidationError) ErrorName() string
- func (e GetTokenResponseValidationError) Field() string
- func (e GetTokenResponseValidationError) Key() bool
- func (e GetTokenResponseValidationError) Reason() string
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPublicKey() []byte
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- func (m *LoginRequest) Validate() error
- func (m *LoginRequest) ValidateAll() error
- type LoginRequestMultiError
- type LoginRequestValidationError
- func (e LoginRequestValidationError) Cause() error
- func (e LoginRequestValidationError) Error() string
- func (e LoginRequestValidationError) ErrorName() string
- func (e LoginRequestValidationError) Field() string
- func (e LoginRequestValidationError) Key() bool
- func (e LoginRequestValidationError) Reason() string
- type LoginResponse
- func (*LoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginResponse) GetChallenge() []byte
- func (x *LoginResponse) GetExpiresOn() int64
- func (*LoginResponse) ProtoMessage()
- func (x *LoginResponse) ProtoReflect() protoreflect.Message
- func (x *LoginResponse) Reset()
- func (x *LoginResponse) String() string
- func (m *LoginResponse) Validate() error
- func (m *LoginResponse) ValidateAll() error
- type LoginResponseMultiError
- type LoginResponseValidationError
- func (e LoginResponseValidationError) Cause() error
- func (e LoginResponseValidationError) Error() string
- func (e LoginResponseValidationError) ErrorName() string
- func (e LoginResponseValidationError) Field() string
- func (e LoginResponseValidationError) Key() bool
- func (e LoginResponseValidationError) Reason() string
- type UnimplementedAuthzServer
- type UnsafeAuthzServer
Constants ¶
const ( Authz_Login_FullMethodName = "/timesheet.v1.Authz/Login" Authz_GetToken_FullMethodName = "/timesheet.v1.Authz/GetToken" )
Variables ¶
var Authz_ServiceDesc = grpc.ServiceDesc{ ServiceName: "timesheet.v1.Authz", HandlerType: (*AuthzServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _Authz_Login_Handler, }, { MethodName: "GetToken", Handler: _Authz_GetToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "timesheet/v1/authz.proto", }
Authz_ServiceDesc is the grpc.ServiceDesc for Authz service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_timesheet_v1_authz_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthzHandler ¶
RegisterAuthzHandler registers the http handlers for service Authz to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthzHandlerClient ¶
func RegisterAuthzHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzClient) error
RegisterAuthzHandlerClient registers the http handlers for service Authz to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthzClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthzClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthzClient" to call the correct interceptors.
func RegisterAuthzHandlerFromEndpoint ¶
func RegisterAuthzHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthzHandlerFromEndpoint is same as RegisterAuthzHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthzHandlerServer ¶
func RegisterAuthzHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzServer) error
RegisterAuthzHandlerServer registers the http handlers for service Authz to "mux". UnaryRPC :call AuthzServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthzHandlerFromEndpoint instead.
func RegisterAuthzServer ¶
func RegisterAuthzServer(s grpc.ServiceRegistrar, srv AuthzServer)
Types ¶
type AuthzClient ¶
type AuthzClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error) }
AuthzClient is the client API for Authz 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 NewAuthzClient ¶
func NewAuthzClient(cc grpc.ClientConnInterface) AuthzClient
type AuthzServer ¶
type AuthzServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error) // contains filtered or unexported methods }
AuthzServer is the server API for Authz service. All implementations must embed UnimplementedAuthzServer for forward compatibility
type GetTokenRequest ¶
type GetTokenRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` ChallengeResponse []byte `protobuf:"bytes,2,opt,name=challenge_response,proto3" json:"challenge_response,omitempty"` // contains filtered or unexported fields }
func (*GetTokenRequest) Descriptor
deprecated
func (*GetTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTokenRequest.ProtoReflect.Descriptor instead.
func (*GetTokenRequest) GetChallengeResponse ¶
func (x *GetTokenRequest) GetChallengeResponse() []byte
func (*GetTokenRequest) GetUsername ¶
func (x *GetTokenRequest) GetUsername() string
func (*GetTokenRequest) ProtoMessage ¶
func (*GetTokenRequest) ProtoMessage()
func (*GetTokenRequest) ProtoReflect ¶
func (x *GetTokenRequest) ProtoReflect() protoreflect.Message
func (*GetTokenRequest) Reset ¶
func (x *GetTokenRequest) Reset()
func (*GetTokenRequest) String ¶
func (x *GetTokenRequest) String() string
func (*GetTokenRequest) Validate ¶
func (m *GetTokenRequest) Validate() error
Validate checks the field values on GetTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*GetTokenRequest) ValidateAll ¶
func (m *GetTokenRequest) ValidateAll() error
ValidateAll checks the field values on GetTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetTokenRequestMultiError, or nil if none found.
type GetTokenRequestMultiError ¶
type GetTokenRequestMultiError []error
GetTokenRequestMultiError is an error wrapping multiple validation errors returned by GetTokenRequest.ValidateAll() if the designated constraints aren't met.
func (GetTokenRequestMultiError) AllErrors ¶
func (m GetTokenRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetTokenRequestMultiError) Error ¶
func (m GetTokenRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetTokenRequestValidationError ¶
type GetTokenRequestValidationError struct {
// contains filtered or unexported fields
}
GetTokenRequestValidationError is the validation error returned by GetTokenRequest.Validate if the designated constraints aren't met.
func (GetTokenRequestValidationError) Cause ¶
func (e GetTokenRequestValidationError) Cause() error
Cause function returns cause value.
func (GetTokenRequestValidationError) Error ¶
func (e GetTokenRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetTokenRequestValidationError) ErrorName ¶
func (e GetTokenRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetTokenRequestValidationError) Field ¶
func (e GetTokenRequestValidationError) Field() string
Field function returns field value.
func (GetTokenRequestValidationError) Key ¶
func (e GetTokenRequestValidationError) Key() bool
Key function returns key value.
func (GetTokenRequestValidationError) Reason ¶
func (e GetTokenRequestValidationError) Reason() string
Reason function returns reason value.
type GetTokenResponse ¶
type GetTokenResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` ExpiresOn int64 `protobuf:"varint,2,opt,name=expires_on,proto3" json:"expires_on,omitempty"` // contains filtered or unexported fields }
func (*GetTokenResponse) Descriptor
deprecated
func (*GetTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTokenResponse.ProtoReflect.Descriptor instead.
func (*GetTokenResponse) GetExpiresOn ¶
func (x *GetTokenResponse) GetExpiresOn() int64
func (*GetTokenResponse) GetToken ¶
func (x *GetTokenResponse) GetToken() string
func (*GetTokenResponse) ProtoMessage ¶
func (*GetTokenResponse) ProtoMessage()
func (*GetTokenResponse) ProtoReflect ¶
func (x *GetTokenResponse) ProtoReflect() protoreflect.Message
func (*GetTokenResponse) Reset ¶
func (x *GetTokenResponse) Reset()
func (*GetTokenResponse) String ¶
func (x *GetTokenResponse) String() string
func (*GetTokenResponse) Validate ¶
func (m *GetTokenResponse) Validate() error
Validate checks the field values on GetTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*GetTokenResponse) ValidateAll ¶
func (m *GetTokenResponse) ValidateAll() error
ValidateAll checks the field values on GetTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetTokenResponseMultiError, or nil if none found.
type GetTokenResponseMultiError ¶
type GetTokenResponseMultiError []error
GetTokenResponseMultiError is an error wrapping multiple validation errors returned by GetTokenResponse.ValidateAll() if the designated constraints aren't met.
func (GetTokenResponseMultiError) AllErrors ¶
func (m GetTokenResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetTokenResponseMultiError) Error ¶
func (m GetTokenResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetTokenResponseValidationError ¶
type GetTokenResponseValidationError struct {
// contains filtered or unexported fields
}
GetTokenResponseValidationError is the validation error returned by GetTokenResponse.Validate if the designated constraints aren't met.
func (GetTokenResponseValidationError) Cause ¶
func (e GetTokenResponseValidationError) Cause() error
Cause function returns cause value.
func (GetTokenResponseValidationError) Error ¶
func (e GetTokenResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetTokenResponseValidationError) ErrorName ¶
func (e GetTokenResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetTokenResponseValidationError) Field ¶
func (e GetTokenResponseValidationError) Field() string
Field function returns field value.
func (GetTokenResponseValidationError) Key ¶
func (e GetTokenResponseValidationError) Key() bool
Key function returns key value.
func (GetTokenResponseValidationError) Reason ¶
func (e GetTokenResponseValidationError) Reason() string
Reason function returns reason value.
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=pub_key,proto3" json:"public_key,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPublicKey ¶
func (x *LoginRequest) GetPublicKey() []byte
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
func (*LoginRequest) Validate ¶
func (m *LoginRequest) Validate() error
Validate checks the field values on LoginRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*LoginRequest) ValidateAll ¶
func (m *LoginRequest) ValidateAll() error
ValidateAll checks the field values on LoginRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoginRequestMultiError, or nil if none found.
type LoginRequestMultiError ¶
type LoginRequestMultiError []error
LoginRequestMultiError is an error wrapping multiple validation errors returned by LoginRequest.ValidateAll() if the designated constraints aren't met.
func (LoginRequestMultiError) AllErrors ¶
func (m LoginRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginRequestMultiError) Error ¶
func (m LoginRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginRequestValidationError ¶
type LoginRequestValidationError struct {
// contains filtered or unexported fields
}
LoginRequestValidationError is the validation error returned by LoginRequest.Validate if the designated constraints aren't met.
func (LoginRequestValidationError) Cause ¶
func (e LoginRequestValidationError) Cause() error
Cause function returns cause value.
func (LoginRequestValidationError) Error ¶
func (e LoginRequestValidationError) Error() string
Error satisfies the builtin error interface
func (LoginRequestValidationError) ErrorName ¶
func (e LoginRequestValidationError) ErrorName() string
ErrorName returns error name.
func (LoginRequestValidationError) Field ¶
func (e LoginRequestValidationError) Field() string
Field function returns field value.
func (LoginRequestValidationError) Key ¶
func (e LoginRequestValidationError) Key() bool
Key function returns key value.
func (LoginRequestValidationError) Reason ¶
func (e LoginRequestValidationError) Reason() string
Reason function returns reason value.
type LoginResponse ¶
type LoginResponse struct { Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` ExpiresOn int64 `protobuf:"varint,2,opt,name=expires_on,proto3" json:"expires_on,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetChallenge ¶
func (x *LoginResponse) GetChallenge() []byte
func (*LoginResponse) GetExpiresOn ¶
func (x *LoginResponse) GetExpiresOn() int64
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
func (*LoginResponse) Validate ¶
func (m *LoginResponse) Validate() error
Validate checks the field values on LoginResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*LoginResponse) ValidateAll ¶
func (m *LoginResponse) ValidateAll() error
ValidateAll checks the field values on LoginResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoginResponseMultiError, or nil if none found.
type LoginResponseMultiError ¶
type LoginResponseMultiError []error
LoginResponseMultiError is an error wrapping multiple validation errors returned by LoginResponse.ValidateAll() if the designated constraints aren't met.
func (LoginResponseMultiError) AllErrors ¶
func (m LoginResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginResponseMultiError) Error ¶
func (m LoginResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginResponseValidationError ¶
type LoginResponseValidationError struct {
// contains filtered or unexported fields
}
LoginResponseValidationError is the validation error returned by LoginResponse.Validate if the designated constraints aren't met.
func (LoginResponseValidationError) Cause ¶
func (e LoginResponseValidationError) Cause() error
Cause function returns cause value.
func (LoginResponseValidationError) Error ¶
func (e LoginResponseValidationError) Error() string
Error satisfies the builtin error interface
func (LoginResponseValidationError) ErrorName ¶
func (e LoginResponseValidationError) ErrorName() string
ErrorName returns error name.
func (LoginResponseValidationError) Field ¶
func (e LoginResponseValidationError) Field() string
Field function returns field value.
func (LoginResponseValidationError) Key ¶
func (e LoginResponseValidationError) Key() bool
Key function returns key value.
func (LoginResponseValidationError) Reason ¶
func (e LoginResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedAuthzServer ¶
type UnimplementedAuthzServer struct { }
UnimplementedAuthzServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthzServer) GetToken ¶
func (UnimplementedAuthzServer) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error)
func (UnimplementedAuthzServer) Login ¶
func (UnimplementedAuthzServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
type UnsafeAuthzServer ¶
type UnsafeAuthzServer interface {
// contains filtered or unexported methods
}
UnsafeAuthzServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthzServer will result in compilation errors.