Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMethodDescriptorNotFound = errors.New("Описание метода не найдено") ErrSessionNotFound = errors.New("Сессия не найдена") ErrSessionHasNotPermissions = errors.New("Сессия не имеет прав на метод API") ErrSessionNotOwnEntity = errors.New("Сессия не имеет прав на сущность API") ErrInternal = func(err error) error { return NewResponseError(codes.Internal, err) } ErrNotFound = func(err error) error { return NewResponseError(codes.NotFound, err) } ErrPermissionDenied = func(err error) error { return NewResponseError(codes.PermissionDenied, err) } ErrInvalidArgument = func(err error) error { return NewResponseError(codes.InvalidArgument, err) } ErrUnauthenticated = func(err error) error { return NewResponseError(codes.Unauthenticated, err) } ErrAlreadyExists = func(err error) error { return NewResponseError(codes.AlreadyExists, err) } ErrTooManyRequests = func(err error) error { return NewResponseError(codes.ResourceExhausted, err) } )
Functions ¶
Types ¶
type ByPriority ¶
type ByPriority []Middleware
func (ByPriority) Len ¶
func (b ByPriority) Len() int
func (ByPriority) Less ¶
func (b ByPriority) Less(i, j int) bool
func (ByPriority) Swap ¶
func (b ByPriority) Swap(i, j int)
type Descriptor ¶
type Descriptor struct { Server interface{} GRPCRegistrar interface{} GRPCGatewayRegistrar func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error MethodDescriptors []MethodDescriptor }
type FxServerIn ¶
type FxServerIn struct { fx.In Ctx context.Context Logger log.Logger ConfigProvider application.Provider GrpcMiddlewares []Middleware `group:"grpc_middleware"` MuxMiddlewares []Middleware `group:"mux_middleware"` }
type MethodDescriptor ¶
type MethodDescriptor struct { Method interface{} Role pbv1.Role Permission pbv1.Permission Form validator.Form }
func (*MethodDescriptor) GetName ¶
func (m *MethodDescriptor) GetName() (string, error)
type MethodDescriptorMap ¶
type MethodDescriptorMap map[string]MethodDescriptor
func NewFxMethodDescriptorMap ¶
func NewFxMethodDescriptorMap( serverDescriptor Descriptor, ) (MethodDescriptorMap, error)
func (MethodDescriptorMap) GetByFullName ¶
func (m MethodDescriptorMap) GetByFullName(fullName string) (MethodDescriptor, bool)
type Middleware ¶
type Middleware struct { Priority int GrpcOption grpc.UnaryServerInterceptor MuxOption runtime.ServeMuxOption }
type MiddlewareOut ¶
type MiddlewareOut struct { fx.Out GrpcMiddleware Middleware `group:"grpc_middleware"` MuxMiddleware Middleware `group:"mux_middleware"` }
type Server ¶
type Server interface { Register(descriptor Descriptor) error Start() error }
func NewFxServer ¶
func NewFxServer( in FxServerIn, ) (Server, error)
Click to show internal directories.
Click to hide internal directories.