infrastructure

package
v0.0.0-...-6f8c8e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents an external data source which provides an REST endpoint delivering JSON bodies to consume

func (*Client) Get

func (c *Client) Get(ctx context.Context, id int) (*domain.Product, error)

Get returns a single product

func (*Client) Inject

func (c *Client) Inject(
	logger flamingo.Logger,
	conf *struct {
		BaseURL        string `inject:"config:productservice.baseurl"`
		ListEndpoint   string `inject:"config:productservice.endpoints.list"`
		DetailEndpoint string `inject:"config:productservice.endpoints.detail"`
	},
)

Inject dependencies

func (*Client) List

func (c *Client) List(ctx context.Context) ([]*domain.Product, error)

List returns all products

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL