Documentation ¶
Index ¶
Constants ¶
View Source
const ( Config = "app.config" ConfigDir = "app.config.dir" )
Variables ¶
This section is empty.
Functions ¶
func ReadYamlFromFile ¶
ReadYamlFromFile read yaml from file directly
Types ¶
type App ¶
type App struct { //是否运行在命令行模式 IsRunInCli bool // project name Title string `json:"title,omitempty"` // project name Project string `json:"project,omitempty" ` // app name Name string `json:"name,omitempty" ` // app description Description string `json:"description,omitempty"` // Version Version string `json:"version,omitempty" default:"${APP_VERSION:v1}"` // TermsOfService TermsOfService string `json:"termsOfService,omitempty"` }
App is the properties of the application, it hold the base info of the application
func (*App) WithDescription ¶
func (*App) WithVersion ¶
type Builder ¶
type Builder interface { Init() error Build(profiles ...string) (p interface{}, err error) BuildWithProfile(profile string) (interface{}, error) Load(properties interface{}, opts ...func(*mapstructure.DecoderConfig)) (err error) Save(p interface{}) (err error) Replace(source string) (retVal interface{}) GetProperty(name string) (retVal interface{}) SetProperty(name string, val interface{}) Builder SetDefaultProperty(name string, val interface{}) Builder SetConfiguration(in interface{}) }
Builder is the config file (yaml, json) builder
func NewPropertyBuilder ¶
NewBuilder is the constructor of system.Builder
type ConfigFile ¶
type ConfigFile struct {
// contains filtered or unexported fields
}
type Configuration ¶
Configuration is the system configuration
func NewConfiguration ¶
func NewConfiguration() *Configuration
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cmap provides concurrent map
|
Package cmap provides concurrent map |
Package factory provides InstantiateFactory and ConfigurableFactory interface
|
Package factory provides InstantiateFactory and ConfigurableFactory interface |
autoconfigure
Package autoconfigure implement ConfigurableFactory
|
Package autoconfigure implement ConfigurableFactory |
depends
Package depends provides dependency resolver for factory
|
Package depends provides dependency resolver for factory |
instantiate
Package instantiate implement InstantiateFactory
|
Package instantiate implement InstantiateFactory |
Package errwrap implements methods to formalize error wrapping in Go.
|
Package errwrap implements methods to formalize error wrapping in Go. |
Package reflector provides utilities for reflection
|
Package reflector provides utilities for reflection |
Package replacer provides utilities that replace the reference and environment variables with its value
|
Package replacer provides utilities that replace the reference and environment variables with its value |
Click to show internal directories.
Click to hide internal directories.