Documentation ¶
Index ¶
- Constants
- Variables
- func AfterPrepare(fn AfterPrepareFunc)
- func AllAccess() bool
- func BindProperty(key string, i interface{})
- func BindPropertyIf(key string, i interface{}, allAccess bool)
- func CollectBeans(i interface{}, selectors ...SpringCore.BeanSelector) bool
- func Config(fn interface{}, tags ...string) *SpringCore.Configer
- func ConfigWithName(name string, fn interface{}, tags ...string) *SpringCore.Configer
- func Exit()
- func ExpectSysProperties(pattern ...string)
- func FindBean(selector SpringCore.BeanSelector) (*SpringCore.BeanDefinition, bool)
- func GetBean(i interface{}, selector ...SpringCore.BeanSelector) bool
- func GetBeanDefinitions() []*SpringCore.BeanDefinition
- func GetBoolProperty(keys ...string) bool
- func GetDefaultProperty(key string, def interface{}) (interface{}, bool)
- func GetDurationProperty(keys ...string) time.Duration
- func GetFloatProperty(keys ...string) float64
- func GetIntProperty(keys ...string) int64
- func GetPrefixProperties(prefix string) map[string]interface{}
- func GetProfile() string
- func GetProperties() map[string]interface{}
- func GetProperty(keys ...string) interface{}
- func GetStringProperty(keys ...string) string
- func GetTimeProperty(keys ...string) time.Time
- func GetUintProperty(keys ...string) uint64
- func Go(fn GoFuncWithContext)
- func PropertiesReadBuffer(buffer []byte, out map[string]interface{})
- func RegisterBean(bean interface{}) *SpringCore.BeanDefinition
- func RegisterBeanDefinition(bd *SpringCore.BeanDefinition) *SpringCore.BeanDefinition
- func RegisterBeanFn(fn interface{}, tags ...string) *SpringCore.BeanDefinition
- func RegisterConfigReader(reader ConfigReader)
- func RegisterFileConfigReader(fileExt string, fn FnReadBuffer)
- func RegisterFilter(bd *SpringCore.BeanDefinition) *SpringCore.BeanDefinition
- func RegisterGRpcClient(fn interface{}, endpoint string) *SpringCore.BeanDefinition
- func RegisterMethodBean(selector SpringCore.BeanSelector, method string, tags ...string) *SpringCore.BeanDefinition
- func RegisterMethodBeanFn(method interface{}, tags ...string) *SpringCore.BeanDefinition
- func RegisterNameBean(name string, bean interface{}) *SpringCore.BeanDefinition
- func RegisterNameBeanFn(name string, fn interface{}, tags ...string) *SpringCore.BeanDefinition
- func RegisterNameMethodBean(name string, selector SpringCore.BeanSelector, method string, tags ...string) *SpringCore.BeanDefinition
- func RegisterNameMethodBeanFn(name string, method interface{}, tags ...string) *SpringCore.BeanDefinition
- func RegisterPropertySource(ps PropertySource)
- func Run(fn interface{}, tags ...string) *SpringCore.Runner
- func RunApplication(configLocation ...string)
- func RunNow(fn interface{}, tags ...string) error
- func RunTestApplication(t *testing.T, waiting time.Duration, configLocation ...string)
- func SetAllAccess(allAccess bool)
- func SetBanner(banner string)
- func SetBannerMode(mode BannerMode)
- func SetProfile(profile string)
- func SetProperty(key string, value interface{})
- func WireBean(bean interface{})
- type AfterPrepareFunc
- type AppBuilder
- type ApplicationConfig
- type ApplicationContext
- type ApplicationEvent
- type BannerMode
- type CommandLineRunner
- type ConditionalBindConsumer
- func (c *ConditionalBindConsumer) And() *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) CheckCondition(ctx SpringCore.SpringContext) bool
- func (c *ConditionalBindConsumer) ConditionNot(cond SpringCore.Condition) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOn(cond SpringCore.Condition) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnBean(selector SpringCore.BeanSelector) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnExpression(expression string) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnMatches(fn SpringCore.ConditionFunc) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnMissingBean(selector SpringCore.BeanSelector) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnMissingProperty(name string) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnProfile(profile string) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnProperty(name string) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) ConditionOnPropertyValue(name string, havingValue interface{}, ...) *ConditionalBindConsumer
- func (c *ConditionalBindConsumer) Or() *ConditionalBindConsumer
- type ConditionalWebFilter
- func (f *ConditionalWebFilter) And() *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionNot(cond SpringCore.Condition) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOn(cond SpringCore.Condition) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnBean(selector SpringCore.BeanSelector) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnExpression(expression string) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnMatches(fn SpringCore.ConditionFunc) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnMissingBean(selector SpringCore.BeanSelector) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnMissingProperty(name string) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnProfile(profile string) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnProperty(name string) *ConditionalWebFilter
- func (f *ConditionalWebFilter) ConditionOnPropertyValue(name string, havingValue interface{}, ...) *ConditionalWebFilter
- func (f *ConditionalWebFilter) Invoke(ctx SpringWeb.WebContext, chain SpringWeb.FilterChain)
- func (f *ConditionalWebFilter) Or() *ConditionalWebFilter
- func (f *ConditionalWebFilter) ResolveFilters(ctx SpringCore.SpringContext) []SpringWeb.Filter
- type ConfigReader
- type FileConfigReader
- type FnReadBuffer
- type GRpcServer
- func (s *GRpcServer) And() *GRpcServer
- func (s *GRpcServer) CheckCondition(ctx SpringCore.SpringContext) bool
- func (s *GRpcServer) ConditionNot(cond SpringCore.Condition) *GRpcServer
- func (s *GRpcServer) ConditionOn(cond SpringCore.Condition) *GRpcServer
- func (s *GRpcServer) ConditionOnBean(selector SpringCore.BeanSelector) *GRpcServer
- func (s *GRpcServer) ConditionOnExpression(expression string) *GRpcServer
- func (s *GRpcServer) ConditionOnMatches(fn SpringCore.ConditionFunc) *GRpcServer
- func (s *GRpcServer) ConditionOnMissingBean(selector SpringCore.BeanSelector) *GRpcServer
- func (s *GRpcServer) ConditionOnMissingProperty(name string) *GRpcServer
- func (s *GRpcServer) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *GRpcServer
- func (s *GRpcServer) ConditionOnProfile(profile string) *GRpcServer
- func (s *GRpcServer) ConditionOnProperty(name string) *GRpcServer
- func (s *GRpcServer) ConditionOnPropertyValue(name string, havingValue interface{}, ...) *GRpcServer
- func (s *GRpcServer) Or() *GRpcServer
- func (s *GRpcServer) Server() interface{}
- func (s *GRpcServer) ServiceName() string
- type GoFuncWithContext
- type JUnitRunner
- type JUnitSuite
- type Mapping
- func DeleteBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func DeleteMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func GetBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func GetMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func HandleDelete(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func HandleGet(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func HandlePost(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func HandlePut(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func PostBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func PostMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func PutBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func PutMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func Request(method uint32, path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func RequestBinding(method uint32, path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func RequestMapping(method uint32, path string, fn SpringWeb.HandlerFunc, ...) *Mapping
- func (m *Mapping) And() *Mapping
- func (m *Mapping) CheckCondition(ctx SpringCore.SpringContext) bool
- func (m *Mapping) ConditionNot(cond SpringCore.Condition) *Mapping
- func (m *Mapping) ConditionOn(cond SpringCore.Condition) *Mapping
- func (m *Mapping) ConditionOnBean(selector SpringCore.BeanSelector) *Mapping
- func (m *Mapping) ConditionOnExpression(expression string) *Mapping
- func (m *Mapping) ConditionOnMatches(fn SpringCore.ConditionFunc) *Mapping
- func (m *Mapping) ConditionOnMissingBean(selector SpringCore.BeanSelector) *Mapping
- func (m *Mapping) ConditionOnMissingProperty(name string) *Mapping
- func (m *Mapping) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *Mapping
- func (m *Mapping) ConditionOnProfile(profile string) *Mapping
- func (m *Mapping) ConditionOnProperty(name string) *Mapping
- func (m *Mapping) ConditionOnPropertyValue(name string, havingValue interface{}, ...) *Mapping
- func (m *Mapping) Filters() []SpringWeb.Filter
- func (m *Mapping) Handler() SpringWeb.Handler
- func (m *Mapping) Key() string
- func (m *Mapping) Mapper() *SpringWeb.Mapper
- func (m *Mapping) Method() uint32
- func (m *Mapping) OnPorts(ports ...int) *Mapping
- func (m *Mapping) Or() *Mapping
- func (m *Mapping) Path() string
- func (m *Mapping) Ports() []int
- func (m *Mapping) Swagger() *SpringWeb.Operation
- type PropertySource
- type Router
- func (r *Router) And() *Router
- func (r *Router) ConditionNot(cond SpringCore.Condition) *Router
- func (r *Router) ConditionOn(cond SpringCore.Condition) *Router
- func (r *Router) ConditionOnBean(selector SpringCore.BeanSelector) *Router
- func (r *Router) ConditionOnExpression(expression string) *Router
- func (r *Router) ConditionOnMatches(fn SpringCore.ConditionFunc) *Router
- func (r *Router) ConditionOnMissingBean(selector SpringCore.BeanSelector) *Router
- func (r *Router) ConditionOnMissingProperty(name string) *Router
- func (r *Router) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *Router
- func (r *Router) ConditionOnProfile(profile string) *Router
- func (r *Router) ConditionOnProperty(name string) *Router
- func (r *Router) ConditionOnPropertyValue(name string, havingValue interface{}, ...) *Router
- func (r *Router) DeleteBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) DeleteMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) GetBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) GetMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) HandleDelete(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) HandleGet(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) HandlePost(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) HandlePut(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) OnPorts(ports ...int) *Router
- func (r *Router) Or() *Router
- func (r *Router) PostBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) PostMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) PutBinding(path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) PutMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) Request(method uint32, path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) RequestBinding(method uint32, path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
- func (r *Router) RequestMapping(method uint32, path string, fn SpringWeb.HandlerFunc, ...) *Mapping
- func (r *Router) Route(basePath string, filters ...SpringWeb.Filter) *Router
- type WebFilterArray
- type WebFilterArrayImpl
- type WebFilterBeanArrayImpl
- type WebMapping
Constants ¶
const ( DefaultConfigLocation = "config/" // 默认的配置文件路径 SpringAccess = "spring.access" // "all" 为允许注入私有字段 SPRING_ACCESS = "SPRING_ACCESS" SpringProfile = "spring.profile" // 运行环境 SPRING_PROFILE = "SPRING_PROFILE" )
Variables ¶
var BindConsumerMapping = map[string]*ConditionalBindConsumer{}
BindConsumerMapping 以 BIND 形式注册的消息消费者的映射表
var DefaultWebMapping = NewWebMapping()
DefaultWebMapping 默认的 Web 路由映射表
var GRpcServerMap = make(map[reflect.Value]*GRpcServer)
GRpcServerMap gRPC 服务列表
Functions ¶
func AfterPrepare ¶
func AfterPrepare(fn AfterPrepareFunc)
AfterPrepare 注册一个 app.prepare() 执行完成之后的扩展点
func BindPropertyIf ¶
BindPropertyIf 根据类型获取属性值,属性名称统一转成小写。
func CollectBeans ¶
func CollectBeans(i interface{}, selectors ...SpringCore.BeanSelector) bool
CollectBeans 收集数组或指针定义的所有符合条件的 Bean,收集到返回 true,否则返 回 false。该函数有两种模式:自动模式和指定模式。自动模式是指 selectors 参数为空, 这时候不仅会收集符合条件的单例 Bean,还会收集符合条件的数组 Bean (是指数组的元素 符合条件,然后把数组元素拆开一个个放到收集结果里面)。指定模式是指 selectors 参数 不为空,这时候只会收集单例 Bean,而且要求这些单例 Bean 不仅需要满足收集条件,而且 必须满足 selector 条件。另外,自动模式下不对收集结果进行排序,指定模式下根据 selectors 列表的顺序对收集结果进行排序。
func ConfigWithName ¶
ConfigWithName 注册一个配置函数,名称的作用是对 Config 进行排重和排顺序。
func ExpectSysProperties ¶
func ExpectSysProperties(pattern ...string)
ExpectSysProperties 期望从系统环境变量中获取到的属性,支持正则表达式
func FindBean ¶
func FindBean(selector SpringCore.BeanSelector) (*SpringCore.BeanDefinition, bool)
FindBean 查询单例 Bean,若多于 1 个则 panic;找到返回 true 否则返回 false。 它和 GetBean 的区别是它在调用后不能保证返回的 Bean 已经完成了注入和绑定过程。
func GetBean ¶
func GetBean(i interface{}, selector ...SpringCore.BeanSelector) bool
GetBean 获取单例 Bean,若多于 1 个则 panic;找到返回 true 否则返回 false。 它和 FindBean 的区别是它在调用后能够保证返回的 Bean 已经完成了注入和绑定过程。
func GetBeanDefinitions ¶
func GetBeanDefinitions() []*SpringCore.BeanDefinition
GetBeanDefinitions 获取所有 Bean 的定义,不能保证解析和注入,请谨慎使用该函数!
func GetBoolProperty ¶
GetBoolProperty 返回 keys 中第一个存在的布尔型属性值,属性名称统一转成小写。
func GetDefaultProperty ¶
GetDefaultProperty 返回属性值,如果没有找到则使用指定的默认值,属性名称统一转成小写。
func GetDurationProperty ¶
GetDurationProperty 返回 keys 中第一个存在的 Duration 类型属性值,属性名称统一转成小写。
func GetFloatProperty ¶
GetFloatProperty 返回 keys 中第一个存在的浮点型属性值,属性名称统一转成小写。
func GetIntProperty ¶
GetIntProperty 返回 keys 中第一个存在的有符号整型属性值,属性名称统一转成小写。
func GetPrefixProperties ¶
GetPrefixProperties 返回指定前缀的属性值集合,属性名称统一转成小写。
func GetProperty ¶
func GetProperty(keys ...string) interface{}
GetProperty 返回 keys 中第一个存在的属性值,属性名称统一转成小写。
func GetStringProperty ¶
GetStringProperty 返回 keys 中第一个存在的字符串型属性值,属性名称统一转成小写。
func GetTimeProperty ¶
GetTimeProperty 返回 keys 中第一个存在的 Time 类型的属性值,属性名称统一转成小写。
func GetUintProperty ¶
GetUintProperty 返回 keys 中第一个存在的无符号整型属性值,属性名称统一转成小写。
func PropertiesReadBuffer ¶
PropertiesReader 使用 properties 读取配置文件
func RegisterBean ¶
func RegisterBean(bean interface{}) *SpringCore.BeanDefinition
RegisterBean 注册单例 Bean,不指定名称,重复注册会 panic。
func RegisterBeanDefinition ¶
func RegisterBeanDefinition(bd *SpringCore.BeanDefinition) *SpringCore.BeanDefinition
RegisterBeanDefinition 注册 BeanDefinition 对象,如果需要 Name 请在调用之前准备好。
func RegisterBeanFn ¶
func RegisterBeanFn(fn interface{}, tags ...string) *SpringCore.BeanDefinition
RegisterBeanFn 注册单例构造函数 Bean,不指定名称,重复注册会 panic。
func RegisterConfigReader ¶
func RegisterConfigReader(reader ConfigReader)
RegisterConfigReader 注册配置读取器
func RegisterFileConfigReader ¶
func RegisterFileConfigReader(fileExt string, fn FnReadBuffer)
RegisterFileConfigReader 注册基于文件的配置读取器
func RegisterFilter ¶
func RegisterFilter(bd *SpringCore.BeanDefinition) *SpringCore.BeanDefinition
RegisterFilter 注册 Web Filter 对象 Bean,如果需要 Name 请在调用之前准备好。
func RegisterGRpcClient ¶
func RegisterGRpcClient(fn interface{}, endpoint string) *SpringCore.BeanDefinition
RegisterGRpcClient 注册 gRPC 服务客户端,fn 是 gRPC 自动生成的客户端构造函数
func RegisterMethodBean ¶
func RegisterMethodBean(selector SpringCore.BeanSelector, method string, tags ...string) *SpringCore.BeanDefinition
RegisterMethodBean 注册成员方法单例 Bean,不指定名称,重复注册会 panic。 必须给定方法名而不能通过遍历方法列表比较方法类型的方式获得函数名,因为不同方法的类型可能相同。 而且 interface 的方法类型不带 receiver 而成员方法的类型带有 receiver,两者类型也不好匹配。
func RegisterMethodBeanFn ¶
func RegisterMethodBeanFn(method interface{}, tags ...string) *SpringCore.BeanDefinition
@Incubate 注册成员方法单例 Bean,不指定名称,重复注册会 panic。 method 形如 ServerInterface.Consumer (接口) 或 (*Server).Consumer (类型)。
func RegisterNameBean ¶
func RegisterNameBean(name string, bean interface{}) *SpringCore.BeanDefinition
RegisterNameBean 注册单例 Bean,需指定名称,重复注册会 panic。
func RegisterNameBeanFn ¶
RegisterNameBeanFn 注册单例构造函数 Bean,需指定名称,重复注册会 panic。
func RegisterNameMethodBean ¶
func RegisterNameMethodBean(name string, selector SpringCore.BeanSelector, method string, tags ...string) *SpringCore.BeanDefinition
RegisterNameMethodBean 注册成员方法单例 Bean,需指定名称,重复注册会 panic。 必须给定方法名而不能通过遍历方法列表比较方法类型的方式获得函数名,因为不同方法的类型可能相同。 而且 interface 的方法类型不带 receiver 而成员方法的类型带有 receiver,两者类型也不好匹配。
func RegisterNameMethodBeanFn ¶
func RegisterNameMethodBeanFn(name string, method interface{}, tags ...string) *SpringCore.BeanDefinition
@Incubate 注册成员方法单例 Bean,需指定名称,重复注册会 panic。 method 形如 ServerInterface.Consumer (接口) 或 (*Server).Consumer (类型)。
func RegisterPropertySource ¶
func RegisterPropertySource(ps PropertySource)
RegisterPropertySource 注册属性源
func RunApplication ¶
func RunApplication(configLocation ...string)
RunApplication 快速启动 SpringBoot 应用
func RunTestApplication ¶
RunTestApplication 启动测试程序,waiting 是测试用例开始前的等待时间,因为不知道程序启动器何时完成
Types ¶
type AfterPrepareFunc ¶
type AfterPrepareFunc func(ctx SpringCore.SpringContext)
AfterPrepareFunc 定义 app.prepare() 执行完成之后的扩展点
type AppBuilder ¶
type AppBuilder struct{}
AppBuilder application 的构造器
func (*AppBuilder) Run ¶
func (cfg *AppBuilder) Run(configLocation ...string)
Run 快速启动 SpringBoot 应用
type ApplicationConfig ¶
type ApplicationConfig struct {
// contains filtered or unexported fields
}
ApplicationConfig 应用程序的配置
type ApplicationContext ¶
type ApplicationContext = SpringCore.SpringContext
思来想去很多遍,看着这个空空的 ApplicationContext 越发感觉多余, 但是我也想不清楚未来到底需不需要更多功能,幸好 GoLang 提供了类型 等价定义的语法,如果未来没有新的用法被探索出来,就去掉下面的实现。
type ApplicationEvent ¶
type ApplicationEvent interface { OnStartApplication(ctx ApplicationContext) // 应用启动的事件 OnStopApplication(ctx ApplicationContext) // 应用停止的事件 }
ApplicationEvent 应用运行过程中的事件
type BannerMode ¶
type BannerMode int
const ( BannerModeOff BannerMode = 0 BannerModeConsole BannerMode = 1 )
type CommandLineRunner ¶
type CommandLineRunner interface {
Run(ctx ApplicationContext)
}
CommandLineRunner 命令行启动器接口
type ConditionalBindConsumer ¶
type ConditionalBindConsumer struct { *SpringMessage.BindConsumer // contains filtered or unexported fields }
ConditionalBindConsumer 为 BindConsumer 添加条件功能
func BindConsumer ¶
func BindConsumer(topic string, fn interface{}) *ConditionalBindConsumer
BindConsumer 注册 BIND 形式的消息消费者
func (*ConditionalBindConsumer) And ¶
func (c *ConditionalBindConsumer) And() *ConditionalBindConsumer
And c=a&&b
func (*ConditionalBindConsumer) CheckCondition ¶
func (c *ConditionalBindConsumer) CheckCondition(ctx SpringCore.SpringContext) bool
CheckCondition 成功返回 true,失败返回 false
func (*ConditionalBindConsumer) ConditionNot ¶
func (c *ConditionalBindConsumer) ConditionNot(cond SpringCore.Condition) *ConditionalBindConsumer
ConditionNot 设置一个取反的 Condition
func (*ConditionalBindConsumer) ConditionOn ¶
func (c *ConditionalBindConsumer) ConditionOn(cond SpringCore.Condition) *ConditionalBindConsumer
ConditionOn 设置一个 Condition
func (*ConditionalBindConsumer) ConditionOnBean ¶
func (c *ConditionalBindConsumer) ConditionOnBean(selector SpringCore.BeanSelector) *ConditionalBindConsumer
ConditionOnBean 设置一个 BeanCondition
func (*ConditionalBindConsumer) ConditionOnExpression ¶
func (c *ConditionalBindConsumer) ConditionOnExpression(expression string) *ConditionalBindConsumer
ConditionOnExpression 设置一个 ExpressionCondition
func (*ConditionalBindConsumer) ConditionOnMatches ¶
func (c *ConditionalBindConsumer) ConditionOnMatches(fn SpringCore.ConditionFunc) *ConditionalBindConsumer
ConditionOnMatches 设置一个 FunctionCondition
func (*ConditionalBindConsumer) ConditionOnMissingBean ¶
func (c *ConditionalBindConsumer) ConditionOnMissingBean(selector SpringCore.BeanSelector) *ConditionalBindConsumer
ConditionOnMissingBean 设置一个 MissingBeanCondition
func (*ConditionalBindConsumer) ConditionOnMissingProperty ¶
func (c *ConditionalBindConsumer) ConditionOnMissingProperty(name string) *ConditionalBindConsumer
ConditionOnMissingProperty 设置一个 MissingPropertyCondition
func (*ConditionalBindConsumer) ConditionOnOptionalPropertyValue ¶
func (c *ConditionalBindConsumer) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *ConditionalBindConsumer
ConditionOnOptionalPropertyValue 设置一个 PropertyValueCondition,当属性值不存在时默认条件成立
func (*ConditionalBindConsumer) ConditionOnProfile ¶
func (c *ConditionalBindConsumer) ConditionOnProfile(profile string) *ConditionalBindConsumer
ConditionOnProfile 设置一个 ProfileCondition
func (*ConditionalBindConsumer) ConditionOnProperty ¶
func (c *ConditionalBindConsumer) ConditionOnProperty(name string) *ConditionalBindConsumer
ConditionOnProperty 设置一个 PropertyCondition
func (*ConditionalBindConsumer) ConditionOnPropertyValue ¶
func (c *ConditionalBindConsumer) ConditionOnPropertyValue(name string, havingValue interface{}, options ...SpringCore.PropertyValueConditionOption) *ConditionalBindConsumer
ConditionOnPropertyValue 设置一个 PropertyValueCondition
func (*ConditionalBindConsumer) Or ¶
func (c *ConditionalBindConsumer) Or() *ConditionalBindConsumer
Or c=a||b
type ConditionalWebFilter ¶
type ConditionalWebFilter struct {
// contains filtered or unexported fields
}
ConditionalWebFilter 为 SpringWeb.Filter 增加一个判断条件
func Filter ¶
func Filter(filters ...SpringWeb.Filter) *ConditionalWebFilter
Filter 封装一个 SpringWeb.Filter 对象
func FilterBean ¶
func FilterBean(selectors ...SpringCore.BeanSelector) *ConditionalWebFilter
FilterBean 封装一个 Bean 选择器
func (*ConditionalWebFilter) And ¶
func (f *ConditionalWebFilter) And() *ConditionalWebFilter
And c=a&&b
func (*ConditionalWebFilter) ConditionNot ¶
func (f *ConditionalWebFilter) ConditionNot(cond SpringCore.Condition) *ConditionalWebFilter
ConditionNot 设置一个取反的 Condition
func (*ConditionalWebFilter) ConditionOn ¶
func (f *ConditionalWebFilter) ConditionOn(cond SpringCore.Condition) *ConditionalWebFilter
ConditionOn 设置一个 Condition
func (*ConditionalWebFilter) ConditionOnBean ¶
func (f *ConditionalWebFilter) ConditionOnBean(selector SpringCore.BeanSelector) *ConditionalWebFilter
ConditionOnBean 设置一个 BeanCondition
func (*ConditionalWebFilter) ConditionOnExpression ¶
func (f *ConditionalWebFilter) ConditionOnExpression(expression string) *ConditionalWebFilter
ConditionOnExpression 设置一个 ExpressionCondition
func (*ConditionalWebFilter) ConditionOnMatches ¶
func (f *ConditionalWebFilter) ConditionOnMatches(fn SpringCore.ConditionFunc) *ConditionalWebFilter
ConditionOnMatches 设置一个 FunctionCondition
func (*ConditionalWebFilter) ConditionOnMissingBean ¶
func (f *ConditionalWebFilter) ConditionOnMissingBean(selector SpringCore.BeanSelector) *ConditionalWebFilter
ConditionOnMissingBean 设置一个 MissingBeanCondition
func (*ConditionalWebFilter) ConditionOnMissingProperty ¶
func (f *ConditionalWebFilter) ConditionOnMissingProperty(name string) *ConditionalWebFilter
ConditionOnMissingProperty 设置一个 MissingPropertyCondition
func (*ConditionalWebFilter) ConditionOnOptionalPropertyValue ¶
func (f *ConditionalWebFilter) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *ConditionalWebFilter
ConditionOnOptionalPropertyValue 设置一个 PropertyValueCondition,当属性值不存在时默认条件成立
func (*ConditionalWebFilter) ConditionOnProfile ¶
func (f *ConditionalWebFilter) ConditionOnProfile(profile string) *ConditionalWebFilter
ConditionOnProfile 设置一个 ProfileCondition
func (*ConditionalWebFilter) ConditionOnProperty ¶
func (f *ConditionalWebFilter) ConditionOnProperty(name string) *ConditionalWebFilter
ConditionOnProperty 设置一个 PropertyCondition
func (*ConditionalWebFilter) ConditionOnPropertyValue ¶
func (f *ConditionalWebFilter) ConditionOnPropertyValue(name string, havingValue interface{}, options ...SpringCore.PropertyValueConditionOption) *ConditionalWebFilter
ConditionOnPropertyValue 设置一个 PropertyValueCondition
func (*ConditionalWebFilter) Invoke ¶
func (f *ConditionalWebFilter) Invoke(ctx SpringWeb.WebContext, chain SpringWeb.FilterChain)
func (*ConditionalWebFilter) Or ¶
func (f *ConditionalWebFilter) Or() *ConditionalWebFilter
Or c=a||b
func (*ConditionalWebFilter) ResolveFilters ¶
func (f *ConditionalWebFilter) ResolveFilters(ctx SpringCore.SpringContext) []SpringWeb.Filter
type ConfigReader ¶
type ConfigReader interface { FileExt() string // 文件扩展名 ReadFile(filename string, out map[string]interface{}) ReadBuffer(buffer []byte, out map[string]interface{}) }
ConfigReader 配置读取器接口
type FileConfigReader ¶
type FileConfigReader struct {
// contains filtered or unexported fields
}
FileConfigReader 基于文件的配置读取器
func NewFileConfigReader ¶
func NewFileConfigReader(fileExt string, fn FnReadBuffer) *FileConfigReader
NewFileConfigReader FileConfigReader 的构造函数
func (*FileConfigReader) FileExt ¶
func (r *FileConfigReader) FileExt() string
func (*FileConfigReader) ReadBuffer ¶
func (r *FileConfigReader) ReadBuffer(buffer []byte, out map[string]interface{})
func (*FileConfigReader) ReadFile ¶
func (r *FileConfigReader) ReadFile(filename string, out map[string]interface{})
type FnReadBuffer ¶
func ViperReadBuffer ¶
func ViperReadBuffer(fileType string) FnReadBuffer
ViperReadBuffer 使用 viper 读取配置文件
type GRpcServer ¶
type GRpcServer struct {
// contains filtered or unexported fields
}
func RegisterGRpcServer ¶
func RegisterGRpcServer(fn interface{}, serviceName string, server interface{}) *GRpcServer
RegisterGRpcServer 注册 gRPC 服务提供者,fn 是 gRPC 自动生成的服务注册函数,serviceName 是服务名称, 必须对应 *_grpc.pg.go 文件里面 grpc.ServiceDesc 的 ServiceName 字段,server 是服务具体提供者对象。
func (*GRpcServer) CheckCondition ¶
func (s *GRpcServer) CheckCondition(ctx SpringCore.SpringContext) bool
CheckCondition 成功返回 true,失败返回 false
func (*GRpcServer) ConditionNot ¶
func (s *GRpcServer) ConditionNot(cond SpringCore.Condition) *GRpcServer
ConditionNot 设置一个取反的 Condition
func (*GRpcServer) ConditionOn ¶
func (s *GRpcServer) ConditionOn(cond SpringCore.Condition) *GRpcServer
ConditionOn 设置一个 Condition
func (*GRpcServer) ConditionOnBean ¶
func (s *GRpcServer) ConditionOnBean(selector SpringCore.BeanSelector) *GRpcServer
ConditionOnBean 设置一个 BeanCondition
func (*GRpcServer) ConditionOnExpression ¶
func (s *GRpcServer) ConditionOnExpression(expression string) *GRpcServer
ConditionOnExpression 设置一个 ExpressionCondition
func (*GRpcServer) ConditionOnMatches ¶
func (s *GRpcServer) ConditionOnMatches(fn SpringCore.ConditionFunc) *GRpcServer
ConditionOnMatches 设置一个 FunctionCondition
func (*GRpcServer) ConditionOnMissingBean ¶
func (s *GRpcServer) ConditionOnMissingBean(selector SpringCore.BeanSelector) *GRpcServer
ConditionOnMissingBean 设置一个 MissingBeanCondition
func (*GRpcServer) ConditionOnMissingProperty ¶
func (s *GRpcServer) ConditionOnMissingProperty(name string) *GRpcServer
ConditionOnMissingProperty 设置一个 MissingPropertyCondition
func (*GRpcServer) ConditionOnOptionalPropertyValue ¶
func (s *GRpcServer) ConditionOnOptionalPropertyValue(name string, havingValue interface{}) *GRpcServer
ConditionOnOptionalPropertyValue 设置一个 PropertyValueCondition,当属性值不存在时默认条件成立
func (*GRpcServer) ConditionOnProfile ¶
func (s *GRpcServer) ConditionOnProfile(profile string) *GRpcServer
ConditionOnProfile 设置一个 ProfileCondition
func (*GRpcServer) ConditionOnProperty ¶
func (s *GRpcServer) ConditionOnProperty(name string) *GRpcServer
ConditionOnProperty 设置一个 PropertyCondition
func (*GRpcServer) ConditionOnPropertyValue ¶
func (s *GRpcServer) ConditionOnPropertyValue(name string, havingValue interface{}, options ...SpringCore.PropertyValueConditionOption) *GRpcServer
ConditionOnPropertyValue 设置一个 PropertyValueCondition
type GoFuncWithContext ¶
type JUnitRunner ¶
type JUnitRunner struct { Suites []JUnitSuite `autowire:"[]?"` // contains filtered or unexported fields }
JUnitRunner 测试集执行器
func (*JUnitRunner) Run ¶
func (r *JUnitRunner) Run(ctx ApplicationContext)
type Mapping ¶
type Mapping struct {
// contains filtered or unexported fields
}
Mapping 封装 Web 路由映射
func DeleteBinding ¶
DeleteBinding 注册 DELETE 方法处理函数
func DeleteMapping ¶
DeleteMapping 注册 DELETE 方法处理函数
func GetBinding ¶
GetBinding 注册 GET 方法处理函数
func GetMapping ¶
GetMapping 注册 GET 方法处理函数
func HandleDelete ¶
HandleDelete 注册 DELETE 方法处理函数
func HandlePost ¶
HandlePost 注册 POST 方法处理函数
func PostBinding ¶
PostBinding 注册 POST 方法处理函数
func PostMapping ¶
PostMapping 注册 POST 方法处理函数
func PutBinding ¶
PutBinding 注册 PUT 方法处理函数
func PutMapping ¶
PutMapping 注册 PUT 方法处理函数
func Request ¶
func Request(method uint32, path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
Request 注册任意 HTTP 方法处理函数
func RequestBinding ¶
func RequestBinding(method uint32, path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
RequestBinding 注册任意 HTTP 方法处理函数
func RequestMapping ¶
func RequestMapping(method uint32, path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
RequestMapping 注册任意 HTTP 方法处理函数
func (*Mapping) CheckCondition ¶
CheckCondition 成功返回 true,失败返回 false
func (*Mapping) ConditionNot ¶
ConditionNot 设置一个取反的 Condition
func (*Mapping) ConditionOn ¶
ConditionOn 设置一个 Condition
func (*Mapping) ConditionOnBean ¶
ConditionOnBean 设置一个 BeanCondition
func (*Mapping) ConditionOnExpression ¶
ConditionOnExpression 设置一个 ExpressionCondition
func (*Mapping) ConditionOnMatches ¶
ConditionOnMatches 设置一个 FunctionCondition
func (*Mapping) ConditionOnMissingBean ¶
ConditionOnMissingBean 设置一个 MissingBeanCondition
func (*Mapping) ConditionOnMissingProperty ¶
ConditionOnMissingProperty 设置一个 MissingPropertyCondition
func (*Mapping) ConditionOnOptionalPropertyValue ¶
ConditionOnOptionalPropertyValue 设置一个 PropertyValueCondition,当属性值不存在时默认条件成立
func (*Mapping) ConditionOnProfile ¶
ConditionOnProfile 设置一个 ProfileCondition
func (*Mapping) ConditionOnProperty ¶
ConditionOnProperty 设置一个 PropertyCondition
func (*Mapping) ConditionOnPropertyValue ¶
func (m *Mapping) ConditionOnPropertyValue(name string, havingValue interface{}, options ...SpringCore.PropertyValueConditionOption) *Mapping
ConditionOnPropertyValue 设置一个 PropertyValueCondition
type PropertySource ¶
type PropertySource interface { // Scheme 返回属性源的标识 Scheme() string // Load 加载属性文件,profile 配置文件剖面,fileLocation 和属性源相关。 Load(fileLocation string, profile string) map[string]interface{} }
PropertySource 属性源接口
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router 路由分组
func (*Router) ConditionNot ¶
ConditionNot 设置一个取反的 Condition
func (*Router) ConditionOn ¶
ConditionOn 设置一个 Condition
func (*Router) ConditionOnBean ¶
ConditionOnBean 设置一个 BeanCondition
func (*Router) ConditionOnExpression ¶
ConditionOnExpression 设置一个 ExpressionCondition
func (*Router) ConditionOnMatches ¶
ConditionOnMatches 设置一个 FunctionCondition
func (*Router) ConditionOnMissingBean ¶
ConditionOnMissingBean 设置一个 MissingBeanCondition
func (*Router) ConditionOnMissingProperty ¶
ConditionOnMissingProperty 设置一个 MissingPropertyCondition
func (*Router) ConditionOnOptionalPropertyValue ¶
ConditionOnOptionalPropertyValue 设置一个 PropertyValueCondition,当属性值不存在时默认条件成立
func (*Router) ConditionOnProfile ¶
ConditionOnProfile 设置一个 ProfileCondition
func (*Router) ConditionOnProperty ¶
ConditionOnProperty 设置一个 PropertyCondition
func (*Router) ConditionOnPropertyValue ¶
func (r *Router) ConditionOnPropertyValue(name string, havingValue interface{}, options ...SpringCore.PropertyValueConditionOption) *Router
ConditionOnPropertyValue 设置一个 PropertyValueCondition
func (*Router) DeleteBinding ¶
DeleteBinding 注册 DELETE 方法处理函数
func (*Router) DeleteMapping ¶
func (r *Router) DeleteMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
DeleteMapping 注册 DELETE 方法处理函数
func (*Router) GetBinding ¶
GetBinding 注册 GET 方法处理函数
func (*Router) GetMapping ¶
func (r *Router) GetMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
GetMapping 注册 GET 方法处理函数
func (*Router) HandleDelete ¶
func (r *Router) HandleDelete(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
HandleDelete 注册 DELETE 方法处理函数
func (*Router) HandlePost ¶
func (r *Router) HandlePost(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
HandlePost 注册 POST 方法处理函数
func (*Router) PostBinding ¶
PostBinding 注册 POST 方法处理函数
func (*Router) PostMapping ¶
func (r *Router) PostMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
PostMapping 注册 POST 方法处理函数
func (*Router) PutBinding ¶
PutBinding 注册 PUT 方法处理函数
func (*Router) PutMapping ¶
func (r *Router) PutMapping(path string, fn SpringWeb.HandlerFunc, filters ...SpringWeb.Filter) *Mapping
PutMapping 注册 PUT 方法处理函数
func (*Router) Request ¶
func (r *Router) Request(method uint32, path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter) *Mapping
Request 注册任意 HTTP 方法处理函数
func (*Router) RequestBinding ¶
func (r *Router) RequestBinding(method uint32, path string, fn interface{}, filters ...SpringWeb.Filter) *Mapping
RequestBinding 注册任意 HTTP 方法处理函数
type WebFilterArray ¶
type WebFilterArray interface {
Get(ctx SpringCore.SpringContext) []SpringWeb.Filter
}
WebFilterArray 首字母小写太难看,因此不管它是否真正需要公开
type WebFilterArrayImpl ¶
type WebFilterArrayImpl struct {
// contains filtered or unexported fields
}
WebFilterArray 首字母小写太难看,因此不管它是否真正需要公开
func (*WebFilterArrayImpl) Get ¶
func (l *WebFilterArrayImpl) Get(ctx SpringCore.SpringContext) []SpringWeb.Filter
type WebFilterBeanArrayImpl ¶
type WebFilterBeanArrayImpl struct {
// contains filtered or unexported fields
}
WebFilterArray 首字母小写太难看,因此不管它是否真正需要公开
func (*WebFilterBeanArrayImpl) Get ¶
func (l *WebFilterBeanArrayImpl) Get(ctx SpringCore.SpringContext) []SpringWeb.Filter
type WebMapping ¶
WebMapping Web 路由映射表