gs

package
v1.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 38

Documentation

Index

Constants

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

Variables

View Source
var NewBean = gs_core.NewBean

NewBean creates a new BeanDefinition.

Functions

func AllowCircularReferences added in v1.2.0

func AllowCircularReferences(enable bool)

AllowCircularReferences enables or disables circular references between beans.

func Banner(banner string)

Banner sets a custom app banner.

func BindArg added in v1.2.0

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

BindArg binds runtime arguments to a given function.

func Boot

func Boot() *gs_app.Boot

Boot initializes and returns a *gs_app.Boot instance.

func Config added in v1.2.0

func Config() *gs_conf.AppConfig

Config returns the app configuration.

func ForceAutowireIsNullable added in v1.2.0

func ForceAutowireIsNullable(enable bool)

ForceAutowireIsNullable forces autowire to be nullable.

func GroupRegister added in v1.2.0

func GroupRegister(fn func(p Properties) ([]*BeanDefinition, error))

GroupRegister registers a group of bean definitions.

func IndexArg added in v1.2.0

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

IndexArg returns an IndexArg with the specified index and argument.

func NilArg

func NilArg() gs_arg.ValueArg

NilArg returns a ValueArg with a nil value.

func OnProperty

func OnProperty(name string) gs_cond.OnPropertyInterface

OnProperty creates a Condition based on a property name and options.

func OptionArg

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

OptionArg returns an OptionArg for the specified function and arguments.

func RefreshProperties added in v1.2.0

func RefreshProperties(p Properties) error

RefreshProperties refreshes the app configuration.

func RegisterExpressFunc added in v1.2.0

func RegisterExpressFunc(name string, fn interface{})

RegisterExpressFunc registers a custom expression function.

func Run

func Run() error

Run runs the app and waits for an interrupt signal to exit.

func ShutDown

func ShutDown(msg ...string)

ShutDown shuts down the app with an optional message.

func Start

func Start() error

Start starts the app, usually for testing purposes.

func Stop

func Stop()

Stop stops the app, usually for testing purposes.

func TagArg added in v1.2.0

func TagArg(tag string) gs_arg.TagArg

TagArg returns a TagArg with the specified tag.

func ValueArg added in v1.2.0

func ValueArg(v interface{}) gs_arg.ValueArg

ValueArg returns a ValueArg with the specified value.

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 BeanDefinition

type BeanDefinition = gs.BeanDefinition

type BeanDestroyFunc added in v1.2.0

type BeanDestroyFunc = gs.BeanDestroyFunc

type BeanDestroyInterface

type BeanDestroyInterface = gs.BeanDestroyInterface

type BeanInitFunc added in v1.2.0

type BeanInitFunc = gs.BeanInitFunc

type BeanInitInterface

type BeanInitInterface = gs.BeanInitInterface

type BeanSelector added in v1.2.0

type BeanSelector = gs.BeanSelector

func BeanSelectorForType

func BeanSelectorForType[T any]() BeanSelector

BeanSelectorForType returns a BeanSelector for the given type.

type CondBean

type CondBean = gs.CondBean

type CondContext added in v1.2.0

type CondContext = gs.CondContext

type CondFunc

type CondFunc = gs.CondFunc

type Condition added in v1.2.0

type Condition = gs.Condition

func And added in v1.2.0

func And(conditions ...Condition) Condition

And creates a Condition that is true if all the given Conditions are true.

func None added in v1.2.0

func None(conditions ...Condition) Condition

None creates a Condition that is true if none of the given Conditions are true.

func Not added in v1.2.0

func Not(c Condition) Condition

Not creates a Condition that negates the given Condition.

func OnBean added in v1.2.0

func OnBean(s BeanSelector) Condition

OnBean creates a Condition based on a BeanSelector.

func OnExpression added in v1.2.0

func OnExpression(expression string) Condition

OnExpression creates a Condition based on a custom expression.

func OnFunc added in v1.2.0

func OnFunc(fn CondFunc) Condition

OnFunc creates a Condition based on the provided function.

func OnMissingBean added in v1.2.0

func OnMissingBean(s BeanSelector) Condition

OnMissingBean creates a Condition for when a specific bean is missing.

func OnMissingProperty added in v1.2.0

func OnMissingProperty(name string) Condition

OnMissingProperty creates a Condition that checks for a missing property.

func OnProfile

func OnProfile(profile string) Condition

OnProfile creates a Condition based on the active profile.

func OnSingleBean added in v1.2.0

func OnSingleBean(s BeanSelector) Condition

OnSingleBean creates a Condition for when only one instance of a bean exists.

func Or added in v1.2.0

func Or(conditions ...Condition) Condition

Or creates a Condition that is true if any of the given Conditions are true.

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 Refreshable

type Refreshable = gs.Refreshable

type RegisteredBean added in v1.2.0

type RegisteredBean = gs.RegisteredBean

func Object

func Object(i interface{}) *RegisteredBean

Object registers a bean definition for a given object.

func Provide

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

Provide registers a bean definition for a given constructor.

func Register added in v1.2.0

func Register(b *BeanDefinition) *RegisteredBean

Register registers a bean definition.

func Runner added in v1.2.0

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

Runner registers a bean definition for an AppRunner.

func Server added in v1.2.0

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

Server registers a bean definition for an AppServer.

Directories

Path Synopsis
internal
gs
Package gs provides all the concepts required for Go-Spring implementation.
Package gs provides all the concepts required for Go-Spring implementation.
gs_app
Package gs_app provides a framework for building and managing Go-Spring applications.
Package gs_app provides a framework for building and managing Go-Spring applications.
gs_arg
Package gs_arg provides a set of tools for working with function arguments.
Package gs_arg provides a set of tools for working with function arguments.
gs_bean
Package gs_bean provides the bean definition for the Go-Spring framework.
Package gs_bean provides the bean definition for the Go-Spring framework.
gs_cond
Package gs_cond provides a set of conditions that can be used for evaluating and combining logical conditions in a flexible way.
Package gs_cond provides a set of conditions that can be used for evaluating and combining logical conditions in a flexible way.
gs_dync
Package gs_dync provides dynamic properties and refreshable objects.
Package gs_dync provides dynamic properties and refreshable objects.

Jump to

Keyboard shortcuts

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