Documentation ¶
Index ¶
- Constants
- type Container
- func (c *Container) GetAuthenticationService(clientId, clientSecret string) authentication.Service
- func (c *Container) GetCatalogService() catalog.Service
- func (c *Container) GetEventsService() events.Service
- func (c *Container) GetHttpAdapter() adapters.Http
- func (c *Container) GetMerchantService() merchant.Service
- func (c *Container) GetOrdersService() orders.Service
Constants ¶
View Source
const ( // EnvProduction is the production env EnvProduction = iota // EnvDevelopment is the dev env EnvDevelopment // EnvSandBox is the local/sandbox env EnvSandBox )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { AuthService authentication.Service MerchantService merchant.Service CatalogService catalog.Service EventsService events.Service OrdersService orders.Service // contains filtered or unexported fields }
Container is the SDK abstractions holder to facilitate the API manipulation
func CreateFromEnvs ¶ added in v1.1.1
func CreateFromEnvs() (c *Container)
CreateFromEnvs creates a new instance of the container struct from envs
"IFOOD_CLIENT_ID" "IFOOD_CLIENT_SECRET" "IFOOD_ENV" (default to Production) always uses the api v2
func (*Container) GetAuthenticationService ¶
func (c *Container) GetAuthenticationService(clientId, clientSecret string) authentication.Service
GetAuthenticationService instantiates an auth service, also adds it to the container
func (*Container) GetCatalogService ¶
GetCatalogService instantiates an catalog service, also adds it to the container
func (*Container) GetEventsService ¶
GetEventsService instantiates an events service, also adds it to the container
func (*Container) GetHttpAdapter ¶
GetHttpAdapter returns new HTTP adapter according to the env
func (*Container) GetMerchantService ¶
GetMerchantService instantiates an merchant service, also adds it to the container
func (*Container) GetOrdersService ¶
GetOrdersService instantiates an orders service, also adds it to the container
Click to show internal directories.
Click to hide internal directories.