Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ApiTitle string `mapstructure:"api_title"` // for openapi ApiVersion string `mapstructure:"api_version"` // for openapi ApiServers []OpenAPIServer `mapstructure:"api_servers"` // for openapi HttpPort int `mapstructure:"http_port"` GinMode string `mapstructure:"gin_mode"` Log bool `mapstructure:"log"` EnableCORS bool `mapstructure:"enable_cors"` APIRoot string `mapstructure:"api_root"` StaticRoutes []StaticRoute `mapstructure:"static_routes"` }
func (*Config) NewOpenAPI ¶
func (*Config) TryServeFiles ¶
func (g *Config) TryServeFiles(sr StaticRoute) gin.HandlerFunc
TryServeFiles attempts to serve static files from the specified directory. If the requested file does not exist, it serves a custom "not found" page.
type ConfigSection ¶
type ConfigSection string
const DefaultConfigSection ConfigSection = "gin-service"
type OpenAPIServer ¶
type OpenAPIServer struct { // on production, this should be the actual url, e.g. https://api.example.com/api/v1 Url string `mapstructure:"url"` Description string `mapstructure:"description"` }
type Route ¶
type Server ¶
func GetServerByConfig ¶
func GetServerByConfig(configSection ConfigSection, c *ioc.Container) *Server
func (*Server) SetSecuritySchemes ¶
func (s *Server) SetSecuritySchemes(schemes openapi.SecuritySchemes)
type StaticRoute ¶
Click to show internal directories.
Click to hide internal directories.