system

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequestErr

func BadRequestErr() *core.Error

func EncodeToken

func EncodeToken(tokenID string) (string, error)

func ForbiddenErr

func ForbiddenErr() *core.Error

func InternalServerErr

func InternalServerErr() *core.Error

Types

type Claims

type Claims struct {
	TokenID string `json:"tokenID"`
	jwt.StandardClaims
}

func DecodeToken

func DecodeToken(tokenString string) (*Claims, error)

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(c *connector.Connector) *Config

func (*Config) GetEntry

func (cfg *Config) GetEntry(key string) internal.IConfigEntry

type ContentType

type ContentType int32
const (
	ContentType_Bytes ContentType = iota
	ContentType_JSON
)

type CoreRPC

type CoreRPC struct {
	RPC
	// contains filtered or unexported fields
}

func NewCoreRPC

func NewCoreRPC(s *System) *CoreRPC

type ErrorRPCState

type ErrorRPCState struct {
	core.ErrorReply
}

type Permissions

type Permissions map[string]string

type ProductRPC

type ProductRPC struct {
	RPC
	// contains filtered or unexported fields
}

func NewProductRPC

func NewProductRPC(s *System) *ProductRPC

type RPC

type RPC struct {
	// contains filtered or unexported fields
}

func NewRPC

func NewRPC(connector *connector.Connector) RPC

type RPCContext

type RPCContext struct {
	Req RPCRequest
	Res RPCResponse
}

type RPCHandler

type RPCHandler func(*RPCContext)

func RequiredAuth

func RequiredAuth() RPCHandler

func RequiredPermissions

func RequiredPermissions(permissions ...string) RPCHandler

type RPCRequest

type RPCRequest struct {
	Header map[string]interface{}
	Data   []byte
}

type RPCResponse

type RPCResponse struct {
	ContentType ContentType
	Header      nats.Header
	Data        interface{}
	Error       error
}

type Route

type Route struct {
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(rpc *RPC, prefix string, middlewares ...RPCHandler) *Route

func (*Route) Handle

func (r *Route) Handle(apiPath string, handlers ...RPCHandler)

func (*Route) Use

func (r *Route) Use(handlers ...RPCHandler)

type System

type System struct {
	// contains filtered or unexported fields
}

func New

func New(lifecycle fx.Lifecycle, config *configs.Config, l *zap.Logger, c *connector.Connector) *System

type TokenRPC

type TokenRPC struct {
	RPC
	// contains filtered or unexported fields
}

func NewTokenRPC

func NewTokenRPC(s *System) *TokenRPC

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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