Documentation ¶
Index ¶
- Constants
- Variables
- func AuthKey(key string, directKeyName ...bool) string
- type AuthParameterGetter
- type AuthParameterSetter
- type Request
- func (r *Request) CheckRequestContent(smsMessage *string, skipSms *bool) error
- func (r *Request) Close(successMessage ...string)
- func (r *Request) FormData() map[string][]string
- func (r *Request) FormFile() (*multipart.FileHeader, error)
- func (r *Request) GetAuthParameter(authMethodProtocol string, key string, directKeyName ...bool) string
- func (r *Request) GetGinCtx() *gin.Context
- func (r *Request) GetParameter(key string) (any, bool)
- func (r *Request) GetRequestClientIp() string
- func (r *Request) GetRequestContent() []byte
- func (r *Request) GetRequestMethod() string
- func (r *Request) GetRequestPath() string
- func (r *Request) GetRequestUserAgent() string
- func (r *Request) GetResourceId(resourceType string) string
- func (r *Request) Init(s *Server, ginCtx *gin.Context, ep api_server.Endpoint, ...)
- func (r *Request) ParseValidate(cmd interface{}) error
- func (r *Request) ParseValidateBody(cmd interface{}) error
- func (r *Request) ParseValidateQuery(cmd interface{}) error
- func (r *Request) ResourceIds() map[string]string
- func (r *Request) Response() api_server.Response
- func (r *Request) Server() api_server.Server
- func (r *Request) SetAuthParameter(authMethodProtocol string, key string, value string, directKeyName ...bool)
- func (r *Request) SetParameter(key string, value any)
- func (r *Request) Validate(cmd interface{}) error
- type Response
- type Server
- func (s *Server) AddEndpoint(ep api_server.Endpoint, withMultitenancy ...bool)
- func (s *Server) AuthParameterGetter(authMethodProtocol string) AuthParameterGetter
- func (s *Server) AuthParameterSetter(authMethodProtocol string) AuthParameterSetter
- func (s *Server) Config() interface{}
- func (s *Server) ConfigPoolService() pool.PoolService
- func (s *Server) DynamicTables() api_server.DynamicTables
- func (s *Server) GinEngine() *gin.Engine
- func (s *Server) Init(ctx app_context.Context, auth auth.Auth, ...) error
- func (s *Server) IsMultitenancy() bool
- func (s *Server) MakeResponseError(gerr generic_error.Error) (int, generic_error.Error)
- func (s *Server) NoRoute() gin.HandlerFunc
- func (s *Server) Run(fin background_worker.Finisher)
- func (s *Server) SetConfigFromPoolService(service pool.PoolService, public ...bool)
- func (s *Server) SetPropagateAuthUser(val bool)
- func (s *Server) SetPropagateContextId(val bool)
- func (s *Server) TenancyManager() multitenancy.Multitenancy
- func (s *Server) Testing() bool
- type ServerConfig
Constants ¶
View Source
const OriginType = "rest_api"
Variables ¶
View Source
var DefaultHttpConfigSection string = "http"
View Source
var TenancyParameter string = "tenancy"
Functions ¶
Types ¶
type AuthParameterGetter ¶
type AuthParameterSetter ¶
type Request ¶
type Request struct { api_server.RequestBase // contains filtered or unexported fields }
func (*Request) CheckRequestContent ¶
func (*Request) GetAuthParameter ¶
func (*Request) GetRequestClientIp ¶
func (*Request) GetRequestContent ¶
func (*Request) GetRequestMethod ¶
func (*Request) GetRequestPath ¶
func (*Request) GetRequestUserAgent ¶
func (*Request) GetResourceId ¶
func (*Request) ParseValidate ¶
func (*Request) ParseValidateBody ¶
func (*Request) ParseValidateQuery ¶
func (*Request) ResourceIds ¶
func (*Request) Response ¶
func (r *Request) Response() api_server.Response
func (*Request) Server ¶
func (r *Request) Server() api_server.Server
func (*Request) SetAuthParameter ¶
func (*Request) SetParameter ¶
type Response ¶
type Response struct { api_server.ResponseBase // contains filtered or unexported fields }
type Server ¶
type Server struct { ServerConfig app_context.WithAppBase generic_error.ErrorManagerBaseHttp auth.WithAuthBase // contains filtered or unexported fields }
func (*Server) AddEndpoint ¶
func (s *Server) AddEndpoint(ep api_server.Endpoint, withMultitenancy ...bool)
func (*Server) AuthParameterGetter ¶
func (s *Server) AuthParameterGetter(authMethodProtocol string) AuthParameterGetter
func (*Server) AuthParameterSetter ¶
func (s *Server) AuthParameterSetter(authMethodProtocol string) AuthParameterSetter
func (*Server) ConfigPoolService ¶
func (s *Server) ConfigPoolService() pool.PoolService
func (*Server) DynamicTables ¶
func (s *Server) DynamicTables() api_server.DynamicTables
func (*Server) Init ¶
func (s *Server) Init(ctx app_context.Context, auth auth.Auth, tenancyManager multitenancy.Multitenancy, configPath ...string) error
func (*Server) IsMultitenancy ¶
func (*Server) MakeResponseError ¶
func (s *Server) MakeResponseError(gerr generic_error.Error) (int, generic_error.Error)
func (*Server) NoRoute ¶
func (s *Server) NoRoute() gin.HandlerFunc
func (*Server) Run ¶
func (s *Server) Run(fin background_worker.Finisher)
func (*Server) SetConfigFromPoolService ¶
func (s *Server) SetConfigFromPoolService(service pool.PoolService, public ...bool)
func (*Server) SetPropagateAuthUser ¶
func (*Server) SetPropagateContextId ¶
func (*Server) TenancyManager ¶
func (s *Server) TenancyManager() multitenancy.Multitenancy
type ServerConfig ¶
type ServerConfig struct { api_server.ServerBaseConfig HOST string `validate:"ip" default:"127.0.0.1"` PORT uint16 `validate:"required"` PATH_PREFIX string `default:"/api"` TRUSTED_PROXIES []string VERBOSE bool VERBOSE_BODY_MAX_LENGTH int `default:"2048"` ALLOW_BLOCKED_TENANCY_PATH bool AUTH_FROM_TENANCY_DB bool `default:"true"` SHADOW_TENANCY_PATH bool TENANCY_ALLOWED_IP_LIST_TAG string TENANCY_ALLOWED_IP_LIST bool TENANCY_PARAMETER string `validate:"omitempty,alphanum"` DEFAULT_RESPONSE_JSON string FORM_SINGLE_FILE_FIELD string `default:"file"` }
Click to show internal directories.
Click to hide internal directories.