pb

package
v0.0.0-...-d57e8b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Authz_Login_FullMethodName    = "/timesheet.v1.Authz/Login"
	Authz_GetToken_FullMethodName = "/timesheet.v1.Authz/GetToken"
)

Variables

View Source
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)

View Source
var File_timesheet_v1_authz_proto protoreflect.FileDescriptor

Functions

func RegisterAuthzHandler

func RegisterAuthzHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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

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

Cause function returns cause value.

func (GetTokenRequestValidationError) Error

Error satisfies the builtin error interface

func (GetTokenRequestValidationError) ErrorName

func (e GetTokenRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetTokenRequestValidationError) Field

Field function returns field value.

func (GetTokenRequestValidationError) Key

Key function returns key value.

func (GetTokenRequestValidationError) Reason

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

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

Cause function returns cause value.

func (GetTokenResponseValidationError) Error

Error satisfies the builtin error interface

func (GetTokenResponseValidationError) ErrorName

ErrorName returns error name.

func (GetTokenResponseValidationError) Field

Field function returns field value.

func (GetTokenResponseValidationError) Key

Key function returns key value.

func (GetTokenResponseValidationError) Reason

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

Cause function returns cause value.

func (LoginRequestValidationError) Error

Error satisfies the builtin error interface

func (LoginRequestValidationError) ErrorName

func (e LoginRequestValidationError) ErrorName() string

ErrorName returns error name.

func (LoginRequestValidationError) Field

Field function returns field value.

func (LoginRequestValidationError) Key

Key function returns key value.

func (LoginRequestValidationError) Reason

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

Cause function returns cause value.

func (LoginResponseValidationError) Error

Error satisfies the builtin error interface

func (LoginResponseValidationError) ErrorName

func (e LoginResponseValidationError) ErrorName() string

ErrorName returns error name.

func (LoginResponseValidationError) Field

Field function returns field value.

func (LoginResponseValidationError) Key

Key function returns key value.

func (LoginResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedAuthzServer

type UnimplementedAuthzServer struct {
}

UnimplementedAuthzServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthzServer) GetToken

func (UnimplementedAuthzServer) Login

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL