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 ¶
func DefaultConfiguration() iris.Configuration
DefaultConfiguration Proxy a call to iris.DefaultConfiguration
func IsDir ¶
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 ¶
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 ¶
JoinPath returns a string that joins any number of path elements into a single path, separating them with slashes.
func Prepare ¶
func Prepare(f func(Initiator))
Prepare A prepared function is passed in for initialization.
func ProfileDirFromEnv ¶
func ProfileDirFromEnv() string
ProfileDirFromEnv reads from environment variable with EnvProfileDir
func ReadProfile ¶
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 ¶
func ServiceLocator() *internal.ServiceLocatorImpl
ServiceLocator Return serviceLocator. Use the service locator to get the service.
func SetConfigurator ¶
func SetConfigurator(c Configurator)
SetConfigurator assigns a Configurator to global configurator
func SetConfigurer ¶
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
type BeforeActivation ¶
type BeforeActivation = IrisBeforeActivation
BeforeActivation is Is the start-up pre-processing of the action.
type BootManager ¶
type BootManager = internal.BootManager
BootManager Can be used to launch in the application.
type BusHandler ¶
type BusHandler = internal.BusHandler
BusHandler is the bus message middleware type.
type Configuration ¶
type Configuration = IrisConfiguration
Configuration is the configuration type of the app.
type Configurator ¶
type Configurator interface {
Configure(obj interface{}, file string, metaData ...interface{}) error
}
Configurator .
type DomainEvent ¶
type DomainEvent = internal.DomainEvent
DomainEvent Interface definition of domain events for subscription and publishing of entities.
type Infra ¶
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 ¶
type IrisBeforeActivation = mvc.BeforeActivation
IrisBeforeActivation represents an type alias to mvc.BeforeActivation
type IrisConfiguration ¶
type IrisConfiguration = iris.Configuration
IrisConfiguration represents an type alias to iris.Configuration
type IrisContext ¶
IrisContext represents an type alias to iris.Context
type Repository ¶
type Repository = internal.Repository
Repository The parent class of the repository, which can be inherited using the parent class's methods.