Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(obj interface{}, file string, metaData ...interface{}) error
- func DefaultConfiguration() iris.Configuration
- func IsDir(dir string) bool
- func IsFile(path string) bool
- func JoinPath(elems ...string) string
- func Logger() *golog.Logger
- func Prepare(f func(Initiator))
- func ProfileDirFromEnv() string
- func Prometheus() *internal.Prometheus
- func ReadProfile(file string, v interface{}) error
- func ServiceLocator() *internal.ServiceLocatorImpl
- func SetConfigurator(c Configurator)
- func SetConfigurer(c Configurer)
- type Application
- type BeforeActivation
- type BootManager
- type Bus
- type BusHandler
- type Configuration
- type Configurator
- type Configurer
- type Context
- type DomainEvent
- type Entity
- type Infra
- type Initiator
- type IrisBeforeActivation
- type IrisConfiguration
- type IrisContext
- type IrisResult
- type LogFields
- type LogRow
- type Repository
- type Result
- type UnitTest
- type Worker
Constants ¶
const ( //TransactionKey for transaction DB handles in the first-level cache TransactionKey = internal.TransactionKey )
Variables ¶
var ( // EnvProfileDir is the name of the environment variable for the search // directory of the profile EnvProfileDir = "FREEDOM_PROJECT_CONFIG" // ProfileENV is the name of the profile directory in environment variable ProfileENV = EnvProfileDir )
Functions ¶
func DefaultConfiguration ¶ added in v1.6.9
func DefaultConfiguration() iris.Configuration
DefaultConfiguration Proxy a call to iris.DefaultConfiguration
func IsDir ¶ added in v1.8.8
IsDir accepts a string with a directory path and tests the path. It returns true if the path exists and it is a directory, and false otherwise.
func IsFile ¶ added in v1.8.8
IsFile accepts a string with a file path and tests the path. It returns true if the path exists and it is a file, and false otherwise.
func JoinPath ¶ added in v1.8.8
JoinPath returns a string that joins any number of path elements into a single path, separating them with slashes.
func Prepare ¶ added in v1.6.2
func Prepare(f func(Initiator))
Prepare A prepared function is passed in for initialization.
func ProfileDirFromEnv ¶ added in v1.8.8
func ProfileDirFromEnv() string
ProfileDirFromEnv reads from environment variable with EnvProfileDir
func Prometheus ¶ added in v1.5.5
func Prometheus() *internal.Prometheus
Prometheus Return prometheus.
func ReadProfile ¶ added in v1.8.8
ReadProfile accepts a string with the name of a profile file, and search the file by detectProfilePath. It will fill v with the configuration by parsing the profile into toml format, and returns nil if the file has found. It returns error, if the file has not been found or any error encountered.
func ServiceLocator ¶ added in v1.8.8
func ServiceLocator() *internal.ServiceLocatorImpl
ServiceLocator Return serviceLocator. Use the service locator to get the service.
func SetConfigurator ¶ added in v1.8.8
func SetConfigurator(c Configurator)
SetConfigurator assigns a Configurator to global configurator
func SetConfigurer ¶ added in v1.6.9
func SetConfigurer(c Configurer)
SetConfigurer assigns a Configurator to global configurator
Types ¶
type Application ¶
type Application interface { // Install the database. A function that returns the Interface type is passed in as a handle to the database. InstallDB(f func() (db interface{})) // Install the redis. A function that returns the redis.Cmdable is passed in as a handle to the client. InstallRedis(f func() (client redis.Cmdable)) // Install a custom data source. A function that returns the Interface type is passed in as a handle to the custom data sources. InstallCustom(f func() interface{}) // Install the middleware for http routing globally. InstallMiddleware(handler iris.Handler) // Assigns specified prefix to the application-level router. // Because of ambiguous naming, I've been create SetPrefixPath as an alternative. // Considering remove this function in the future. InstallParty(relativePath string) // NewRunner Can be used as an argument for the `Run` method. NewRunner(addr string, configurators ...host.Configurator) iris.Runner // NewH2CRunner Create a Runner for H2C . NewH2CRunner(addr string, configurators ...host.Configurator) iris.Runner // NewAutoTLSRunner Can be used as an argument for the `Run` method. NewAutoTLSRunner(addr string, domain string, email string, configurators ...host.Configurator) iris.Runner // NewTLSRunner Can be used as an argument for the `Run` method. NewTLSRunner(addr string, certFile, keyFile string, configurators ...host.Configurator) iris.Runner // Go back to the iris app. Iris() *iris.Application // Return to global logger. Logger() *golog.Logger // Run serving an iris application as the HTTP server to handle the incoming requests Run(serve iris.Runner, c iris.Configuration) // Adds a builder function which builds a BootManager. BindBooting(f func(bootManager BootManager)) // Install the middleware for the message bus. InstallBusMiddleware(handle ...BusHandler) InstallSerializer(marshal func(v interface{}) ([]byte, error), unmarshal func(data []byte, v interface{}) error) }
Application Represents an application of freedom
func NewApplication ¶ added in v1.0.5
func NewApplication() Application
NewApplication Create an application.
type BeforeActivation ¶ added in v1.7.1
type BeforeActivation = IrisBeforeActivation
BeforeActivation is Is the start-up pre-processing of the action.
type BootManager ¶ added in v1.8.9
type BootManager = internal.BootManager
BootManager Can be used to launch in the application.
type BusHandler ¶ added in v1.6.2
type BusHandler = internal.BusHandler
BusHandler is the bus message middleware type.
type Configuration ¶ added in v1.6.9
type Configuration = IrisConfiguration
Configuration is the configuration type of the app.
type Configurator ¶ added in v1.8.8
type Configurator interface {
Configure(obj interface{}, file string, metaData ...interface{}) error
}
Configurator .
type DomainEvent ¶ added in v1.8.6
type DomainEvent = internal.DomainEvent
DomainEvent Interface definition of domain events for subscription and publishing of entities.
type Infra ¶ added in v1.3.0
Infra The parent class of the infrastructure, which can be inherited using the parent class's methods.
type Initiator ¶
Initiator Initialize the binding relationship between the user's code and the associated code.
type IrisBeforeActivation ¶ added in v1.8.8
type IrisBeforeActivation = mvc.BeforeActivation
IrisBeforeActivation represents an type alias to mvc.BeforeActivation
type IrisConfiguration ¶ added in v1.8.8
type IrisConfiguration = iris.Configuration
IrisConfiguration represents an type alias to iris.Configuration
type IrisContext ¶ added in v1.8.8
IrisContext represents an type alias to iris.Context
type IrisResult ¶ added in v1.8.8
IrisResult represents an type alias to hero.Result
type Repository ¶
type Repository = internal.Repository
Repository The parent class of the repository, which can be inherited using the parent class's methods.
Directories ¶
Path | Synopsis |
---|---|
example
|
|
base/adapter/repository
Package repository code generated by 'freedom new-project base'
|
Package repository code generated by 'freedom new-project base' |
base/domain
Package domain generated by 'freedom new-project base'
|
Package domain generated by 'freedom new-project base' |
base/domain/po
Package po generated by 'freedom new-project base'
|
Package po generated by 'freedom new-project base' |
base/domain/vo
Package vo generated by 'freedom new-project base'
|
Package vo generated by 'freedom new-project base' |
base/infra
Package infra generated by 'freedom new-project base'
|
Package infra generated by 'freedom new-project base' |
base/server
Package main code generated by 'freedom new-project base'
|
Package main code generated by 'freedom new-project base' |
fshop/domain/po
Package po generated by 'freedom new-po'
|
Package po generated by 'freedom new-po' |
fshop/infra
Package infra code generated by 'freedom new-project base'
|
Package infra code generated by 'freedom new-project base' |
fshop/server
Code generated by 'freedom new-project fshop'
|
Code generated by 'freedom new-project fshop' |
infra-example/domain/po
Package po generated by 'freedom new-po'
|
Package po generated by 'freedom new-po' |
infra-example/domain/vo
Package vo code generated by 'freedom new-project infra-example'
|
Package vo code generated by 'freedom new-project infra-example' |
infra-example/infra
Package infra code generated by 'freedom new-project base'
|
Package infra code generated by 'freedom new-project base' |
infra-example/server
Code generated by 'freedom new-project infra-example'
|
Code generated by 'freedom new-project infra-example' |
infra
|
|