Documentation
¶
Index ¶
- Variables
- func AddPaginationToContext(ctx *gin.Context) context.Context
- func ParseQueryFields(q string, allowed []string, locked []string) ([]string, map[string]bool, error)
- func WithTimeout(timeout time.Duration) func(options *Options)
- type AuthError
- type CORS
- type Configuration
- type EmptyResponse
- type Error
- type ErrorPayload
- type Options
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidFieldsQuery = errors.New("Invalid fields query")
Functions ¶
func AddPaginationToContext ¶
AddPaginationToContext adds the pagination parameters to the context
func ParseQueryFields ¶
func ParseQueryFields(q string, allowed []string, locked []string) ([]string, map[string]bool, error)
ParseQueryFields parses the query fields and returns a fields and an alias map Use fieldsMap to check if a field is present in the query
func WithTimeout ¶
Types ¶
type CORS ¶
type CORS struct { // IsEnabled is the flag to enable/disable CORS IsEnabled bool `yaml:"enabled" json:"enabled,omitempty" mapstructure:"enabled"` // AllowedOrigins is the list of allowed origins AllowedOrigins []string `yaml:"allowedOrigins" json:"allowedOrigins,omitempty" mapstructure:"allowedOrigins"` }
Cross Origin Resource Sharing configuration
type Configuration ¶
type Configuration struct { // Address is the address of the HTTP server Address string `yaml:"address" json:"address" mapstructure:"address"` // PathPrefix is the prefix for the endpoints PathPrefix string `yaml:"pathPrefix" json:"pathPrefix" mapstructure:"pathPrefix"` // TLS is the TLS configuration for the HTTP server TLS tls.TLS `mapstructure:"tls" yaml:"tls" json:"tls"` }
Http configuration for the API with TLS settings
type ErrorPayload ¶
type ErrorPayload struct { Error string `json:"error" mapstructure:"error"` Code int `json:"code" mapstructure:"code"` Description string `json:"description" mapstructure:"description"` }
swagger:model errorResponse
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config Configuration, obs observability.Observability, optionFuncs ...func(*Options)) *Server
Click to show internal directories.
Click to hide internal directories.