Versions in this module Expand all Collapse all v0 v0.0.3 Sep 13, 2025 Changes in this version type Middleware + ActOn []string + func (m *Middleware) ShouldActOn(method string) bool v0.0.2 Sep 13, 2025 Changes in this version + const EndpointTypeHTTP + const EndpointTypeNATS + func InList[T comparable](value T, list []T) bool type Endpoint + GetTypes func() []string v0.0.1 Sep 12, 2025 Changes in this version + type Configs struct + ApiKey string + Host string + Port int + Type ConnectionType + func (c Configs) Connect() error + func (c Configs) ConnectionTypeAllowed() bool + type ConnectionType string + const HTTP + const NATS + type Endpoint interface + GetMethod func() Method + GetPath func() string + Handle func(context.Context) (*Response, error) + Parse func(context.Context, *Request) error + Validate func(context.Context) error + type HttpServer struct + Configs Configs + func (h *HttpServer) Start(routes Routes) error + type Method string + const ConnectMethod + const DeleteMethod + const GetMethod + const HeadMethod + const OptionsMethod + const PatchMethod + const PostMethod + const PutMethod + const TraceMethod + type Middleware struct + Fn func(ctx context.Context, r *Request) error + Name string + func NewMiddleware(fn func(ctx context.Context, r *Request) error, name string) *Middleware + func (m *Middleware) GetFn() func(ctx context.Context, r *Request) error + func (m *Middleware) GetName() string + func (m *Middleware) Run(ctx context.Context, r *Request) error + func (m *Middleware) SetFn(fn func(ctx context.Context, r *Request) error) + func (m *Middleware) SetName(name string) + type NatsServer struct + Configs Configs + func (s *NatsServer) ConnectNats(routes Routes) error + type Request struct + Body map[string]interface{} + Context context.Context + Files map[string][]*multipart.FileHeader + FormFields map[string][]string + Header map[string]interface{} + Params map[string]interface{} + QueryParams map[string]interface{} + func (r *Request) AssignTo(dest interface{}) error + func (r *Request) GetBody() map[string]interface{} + func (r *Request) GetContext() context.Context + func (r *Request) GetFiles() map[string][]*multipart.FileHeader + func (r *Request) GetFormFields() map[string][]string + func (r *Request) GetHeader() map[string]interface{} + func (r *Request) GetParams() map[string]interface{} + func (r *Request) GetQueryParams() map[string]interface{} + func (r *Request) GetValue(key string) interface{} + func (r *Request) HasBody(key string) bool + func (r *Request) HasFile(key string) bool + func (r *Request) HasFormField(key string) bool + func (r *Request) HasHeader(key string) bool + func (r *Request) HasParam(key string) bool + func (r *Request) HasQueryParam(key string) bool + func (r *Request) HasValue(key string) bool + func (r *Request) SetBodyValue(key string, value interface{}) + func (r *Request) SetContext(ctx context.Context) + func (r *Request) SetFileValue(key string, value []*multipart.FileHeader) + func (r *Request) SetFormFieldValue(key string, value []string) + func (r *Request) SetHeaderValue(key string, value interface{}) + func (r *Request) SetParamValue(key string, value interface{}) + func (r *Request) SetQueryParamValue(key string, value interface{}) + func (r *Request) ToJsonBytes() ([]byte, error) + type Response struct + Code int + Data any + Errors []string + func NewErrorResponse(errors []string, code int) *Response + func NewResponse(data any, code int) *Response + func (r *Response) GetCode() int + func (r *Response) GetData() any + func (r *Response) GetErrors() []string + func (r *Response) IsSuccess() bool + func (r *Response) SetCode(code int) + func (r *Response) SetData(data any) + func (r *Response) SetErrors(errors []string) + func (r *Response) ToJsonBytes() []byte + type Route struct + Endpoint Endpoint + TimeoutInSeconds int + func (r *Route) Handle(ctx context.Context, request *Request) (*Response, error) + type Router struct + Configs []Configs + Routes []Routes + func NewRouter(configs []Configs, routes []Routes) *Router + func (r *Router) AddConfig(config Configs) + func (r *Router) AddRoute(route Routes) + func (r *Router) GetConfigs() []Configs + func (r *Router) GetRoutes() []Routes + func (r *Router) Run() error + func (r *Router) SetConfigs(configs []Configs) + func (r *Router) SetRoutes(routes []Routes) + type Routes struct + Base string + Middlewares []Middleware + Routes []Route + func (r Routes) GetFullPath(path string) string + func (r Routes) ToJSON() string