Help us shape the future of Go! Take the 2026 Go Developer Survey

gobay

package module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 10 Imported by: 0

README

gobay

Go Report Card Build Status

Documentation

Contributing

如何为gobay编写extension

  1. 实现 gobay.Extension
  2. 每一个 ext 目录都是你的例子

附录

ext

ent/orm

关于时间

// 如果需要开启 parseTime,在 dsn 中加上参数:
// 显式指定loc为UTC
parseTime=True&loc=UTC

虽然 loc 默认值为 UTC,但是这依赖于默认情况。默认情况有可能发生改变。所以我们推荐显式指定 loc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigByPrefix

func GetConfigByPrefix(config *viper.Viper, prefix string, trimPrefix bool) *viper.Viper

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

Application struct

func CreateApp

func CreateApp(rootPath string, env string, exts map[Key]Extension) (*Application, error)

CreateApp create an gobay Application

func (*Application) Close

func (d *Application) Close() error

Close close app when exit

func (*Application) Config

func (d *Application) Config() *viper.Viper

Config returns the viper config for this application

func (*Application) Env

func (d *Application) Env() string

func (*Application) Get

func (d *Application) Get(key Key) Extension

Get the extension at the specified key, return nil when the component doesn't exist

func (*Application) GetOK

func (d *Application) GetOK(key Key) (Extension, bool)

GetOK the extension at the specified key, return false when the component doesn't exist

func (*Application) Init

func (d *Application) Init() error

Init the application and its extensions with the config.

type Extension

type Extension interface {
	Object() interface{}
	Application() *Application
	Init(app *Application) error
	Close() error
}

Extension like db, cache

type Key

type Key string

A Key represents a key for a Extension.

Directories

Path Synopsis
cmd
gobay command
echo
extensions
asynctaskext
How can I check that a running asynctask worker can otherwise process a new message within 5 seconds (health check)? - `curl 127.0.0.1:5000/health?timeout=5&queue=gobay.task_sub` - `curl 127.0.0.1:5000/health?timeout=5` **default queue**
How can I check that a running asynctask worker can otherwise process a new message within 5 seconds (health check)? - `curl 127.0.0.1:5000/health?timeout=5&queue=gobay.task_sub` - `curl 127.0.0.1:5000/health?timeout=5` **default queue**
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL