Documentation ¶
Index ¶
- Constants
- Variables
- type Container
- type ServiceDefinition
- type ServiceFunc
- type ServiceType
- type Type
- func (c *Type) Get(key string) interface{}
- func (c *Type) GetAPIKeyRepo() key.APIKeyRepo
- func (c *Type) GetAuthKeyRepo() key.AuthKeyRepo
- func (c *Type) GetResolveService() *resolver.Service
- func (c *Type) GetStoreRepo() store.Repository
- func (c *Type) GetSubscriptionRepo() subscription.Repository
- func (c *Type) GetTicketRepo() ticket.Repository
- func (c *Type) GetWebhookRepo() webhook.Repository
- func (c *Type) Has(key string) bool
- func (c *Type) SetNonShared(key string, f ServiceFunc)
- func (c *Type) SetShared(key string, f ServiceFunc)
Constants ¶
const ( APIKey = "api-key" AuthKey = "auth-key" Resolver = "resolver" Subscription = "subscription" Ticket = "ticket" Webhook = "webhook" )
API keys
Variables ¶
var Instance = Type{ // contains filtered or unexported fields }
Instance is the main bitmaelum service container
Functions ¶
This section is empty.
Types ¶
type ServiceDefinition ¶
type ServiceDefinition struct { Func ServiceFunc Type ServiceType }
ServiceDefinition is a single service definition
type ServiceFunc ¶
type ServiceFunc func() (interface{}, error)
ServiceFunc is the function that needs to be resolved in the definition
type ServiceType ¶
type ServiceType int
ServiceType defines what kind of service it is (singleton, or new instance on each call)
const ()
Service types
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is the main container structure holding all service
func (*Type) GetAPIKeyRepo ¶
func (c *Type) GetAPIKeyRepo() key.APIKeyRepo
GetAPIKeyRepo will return the current api key repository
func (*Type) GetAuthKeyRepo ¶
func (c *Type) GetAuthKeyRepo() key.AuthKeyRepo
GetAuthKeyRepo will return the current auth key repository
func (*Type) GetResolveService ¶
GetResolveService will return the current resolver service
func (*Type) GetStoreRepo ¶
func (c *Type) GetStoreRepo() store.Repository
GetStoreRepo will return the current store repository
func (*Type) GetSubscriptionRepo ¶
func (c *Type) GetSubscriptionRepo() subscription.Repository
GetSubscriptionRepo will return the current subscription repository
func (*Type) GetTicketRepo ¶
func (c *Type) GetTicketRepo() ticket.Repository
GetTicketRepo will return the current ticket repository
func (*Type) GetWebhookRepo ¶
func (c *Type) GetWebhookRepo() webhook.Repository
GetWebhookRepo will return the current webhook repository
func (*Type) SetNonShared ¶
func (c *Type) SetNonShared(key string, f ServiceFunc)
SetNonShared will set the function for the given service. It is not shared, meaning you will get a new instance on each call to get
func (*Type) SetShared ¶
func (c *Type) SetShared(key string, f ServiceFunc)
SetShared will set the function for the given service. It will return a shared instance on each call to get