Documentation ¶
Index ¶
- Constants
- Variables
- func Builder(name string) (sqlquery.Builder, error)
- func Cache(name string) (cache.Interface, error)
- func Initialize(config interface{}, hooks ...int) error
- func Logger() *logger.Logger
- func Router() *router.Manager
- func Run() error
- type CacheProvider
- type Config
- type RouterProvider
- type Server
- type UrlSource
Constants ¶
View Source
const ( LOGGER = iota + 1 BUILDER ROUTER CACHE )
View Source
const DEFAULT = "default"
Variables ¶
View Source
var (
ErrConfigNotLoaded = errors.New("server: config is not loaded")
)
View Source
var (
ErrNoRouterConfig = errors.New("server: no router is configured")
)
Functions ¶
func Builder ¶
Builder returns the configured database. If no database is defined, the builder will be nil.
func Initialize ¶
Initialize is init the log, builder, router and cache by config.
Types ¶
type CacheProvider ¶
type Config ¶
type Config struct { Databases []*sqlquery.Config `json:"databases" validate:"min=1"` Server Server `json:"server" validate:"required"` Router RouterProvider `json:"router" validate:"required"` CacheManager []CacheProvider `json:"caches" validate:"min=1"` }
type RouterProvider ¶
Click to show internal directories.
Click to hide internal directories.