Documentation ¶
Index ¶
- Constants
- func CreateAPI(bus *cbus.Bus, repos *Repos) *api.API
- func CreateCBus(repos *Repos) *cbus.Bus
- func CreateSQLRepo(config *config.Config) (*sqlrepo.Repo, io.Closer, error)
- func CreateServer(c *config.Config) *server.Server
- func RegisterClientCommands(bus *cbus.Bus, clients client.Repo)
- func RegisterUserCommands(bus *cbus.Bus, users user.Repo)
- type APIFactory
- type App
- type AppBuilder
- type CBusFactory
- type Repos
- type SQLRepoFactory
- type ServerFactory
Constants ¶
const ( ConfigKeyDatabaseURL = "databases.app.url" SQLDatasourceName = "postgres" )
const (
ConfigKeyServerPort = "server.port"
)
Variables ¶
This section is empty.
Functions ¶
func CreateAPI ¶
CreateAPI returns a new api.API populated with bus and the query repositories in repos.
func CreateCBus ¶
CreateCBus returns a new cbus.Bus with user and client commands registered on it.
func CreateSQLRepo ¶
CreateSQLRepo returns a new sqlrepo.Repo and an io.Closer that will close the connection to the database.
It connects to a Postgresql database at the url specified in config at key ConfigKeyDatabaseURL.
func CreateServer ¶
CreateServer returns a new Server that listens on the port specified in c at key ConfigKeyServerPort.
Types ¶
type APIFactory ¶
APIFactory is a function type that creates a new API ready for use.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the central application type for the gfsweb executable.
type AppBuilder ¶
type AppBuilder struct { SQLRepoFactory CBusFactory APIFactory ServerFactory }
AppBuilder is a type that knows how to initialize and build everything required for an App.
func NewAppBuilder ¶
func NewAppBuilder() *AppBuilder
NewAppBuilder returns a new AppBuilder with fields set to default values.
type CBusFactory ¶
CBusFactory is a function type that creates a new cbus.Bus will all required Commands and Handlers correctly registered.
type Repos ¶
Repos is a collection of domain type repositories used throughout the application. Passing this collection around is easier than passing all of them individually.
type SQLRepoFactory ¶
SQLRepoFactory is a function type that creates a new sqlrepo.Reop and a related io.Closer that should close the connection to the database.