gs

package
v1.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 38

Documentation

Index

Constants

View Source
const (
	Version = "go-spring@v1.1.3"
	Website = "https://go-spring.com/"
)

Variables

This section is empty.

Functions

func AllowCircularReferences added in v1.2.0

func AllowCircularReferences(enable bool)
func Banner(banner string)

Banner 自定义 banner 字符串。

func BindArg added in v1.2.0

func BindArg(fn interface{}, args []Arg, skip int) (*gs_arg.Callable, error)

func BootAccept

func BootAccept(bd *gs.UnregisteredBean) *gs.RegisteredBean

func BootConfig

func BootConfig() *gs_conf.BootConfig

func BootGroup

func BootGroup(fn func(p gs.Properties) ([]*gs.UnregisteredBean, error))

func BootObject

func BootObject(i interface{}) *gs.RegisteredBean

func BootProvide

func BootProvide(ctor interface{}, args ...gs.Arg) *gs.RegisteredBean

func BootRunner

func BootRunner(objOrCtor interface{}, ctorArgs ...gs.Arg) *gs.RegisteredBean

func Config added in v1.2.0

func Config() *gs_conf.AppConfig

func ForceAutowireIsNullable added in v1.2.0

func ForceAutowireIsNullable(enable bool)

func Group added in v1.2.3

func Group(fn func(p Properties) ([]*UnregisteredBean, error))

func IndexArg added in v1.2.0

func IndexArg(n int, arg Arg) gs_arg.IndexArg

IndexArg returns an IndexArg.

func MustBindArg

func MustBindArg(fn interface{}, args ...Arg) *gs_arg.Callable

MustBindArg 为 Option 方法绑定运行时参数。

func NilArg

func NilArg() gs_arg.ValueArg

NilArg return a ValueArg with a value of nil.

func OptionArg

func OptionArg(fn interface{}, args ...Arg) *gs_arg.OptionArg

OptionArg 返回 Option 函数的参数绑定。

func RefreshProperties added in v1.2.0

func RefreshProperties(p Properties) error

func Run

func Run() error

Run 启动程序。

func ShutDown

func ShutDown(msg ...string)

ShutDown 停止程序。

func Start

func Start() error

Start 启动程序。

func Stop

func Stop()

Stop 停止程序。

func ValueArg added in v1.2.0

func ValueArg(v interface{}) gs_arg.ValueArg

ValueArg return a ValueArg with a value of v.

Types

type AppContext

type AppContext = gs_app.AppContext

type AppRunner

type AppRunner = gs_app.AppRunner

type AppServer

type AppServer = gs_app.AppServer

type Arg added in v1.2.0

type Arg = gs.Arg

type BeanDestroy

type BeanDestroy = gs_bean.BeanDestroy

type BeanInit

type BeanInit = gs_bean.BeanInit

type BeanSelector added in v1.2.0

type BeanSelector = gs.BeanSelector

type CondContext added in v1.2.0

type CondContext = gs.CondContext

type Condition added in v1.2.0

type Condition = gs.Condition

func And added in v1.2.0

func And(cond ...Condition) Condition

And returns a Condition that returns true when all the given Conditions return true.

func None added in v1.2.0

func None(cond ...Condition) Condition

None returns a Condition that returns true when none of the given Conditions returns true.

func Not added in v1.2.0

func Not(c Condition) Condition

Not returns a Condition that returns true when the given Condition returns false.

func OK

func OK() Condition

OK returns a Condition that always returns true.

func Or added in v1.2.0

func Or(cond ...Condition) Condition

Or returns a Condition that returns true when any of the given Conditions returns true.

type Conditional

type Conditional = gs_cond.Conditional

func OnBean added in v1.2.0

func OnBean(selector BeanSelector) *Conditional

func OnExpression added in v1.2.0

func OnExpression(expression string) *Conditional

func OnMatches

func OnMatches(fn func(ctx CondContext) (bool, error)) *Conditional

func OnMissingBean added in v1.2.0

func OnMissingBean(selector BeanSelector) *Conditional

func OnMissingProperty added in v1.2.0

func OnMissingProperty(name string) *Conditional

func OnProfile

func OnProfile(profile string) *Conditional

func OnProperty

func OnProperty(name string, options ...PropertyOption) *Conditional

func OnSingleBean added in v1.2.0

func OnSingleBean(selector BeanSelector) *Conditional

type Context

type Context = gs.Context

type ContextAware added in v1.1.1

type ContextAware = gs.ContextAware

type Dync added in v1.2.0

type Dync[T any] = gs_dync.Value[T]

type Properties

type Properties = gs.Properties

type PropertyOption

type PropertyOption = gs_cond.PropertyOption

func HavingValue

func HavingValue(havingValue string) PropertyOption

func MatchIfMissing

func MatchIfMissing() PropertyOption

type RegisteredBean added in v1.2.0

type RegisteredBean = gs.RegisteredBean

func Accept

func Accept(b *UnregisteredBean) *RegisteredBean

Accept 参考 Container.Accept 的解释。

func Object

func Object(i interface{}) *RegisteredBean

Object 参考 Container.Object 的解释。

func Provide

func Provide(ctor interface{}, args ...Arg) *RegisteredBean

Provide 参考 Container.Provide 的解释。

func Runner added in v1.2.0

func Runner(objOrCtor interface{}, ctorArgs ...Arg) *RegisteredBean

func Server added in v1.2.0

func Server(objOrCtor interface{}, ctorArgs ...Arg) *RegisteredBean

type UnregisteredBean

type UnregisteredBean = gs.UnregisteredBean

Directories

Path Synopsis
internal
gs
gs_arg
Package gs_arg 用于实现函数参数绑定。
Package gs_arg 用于实现函数参数绑定。
gs_cond
Package gs_cond provides many conditions used when registering bean.
Package gs_cond provides many conditions used when registering bean.

Jump to

Keyboard shortcuts

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