get

package
v0.0.0-...-7c18459 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Logger() logging.Logger
	DataDSN() string
}

Config is the configuration for Getter

type Getter

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

Getter will attempt to load a person. It can return an error caused by the data layer or when the requested person is not found

func NewGetter

func NewGetter(cfg Config) *Getter

NewGetter creates and initializes a Getter

func (*Getter) Do

func (g *Getter) Do(ID int) (*Person, error)

Do will perform the get

type Person

type Person struct {
	ID       int
	FullName string
	Phone    string
	Currency string
	Price    float64
}

Person is a copy/sub-set of data.Person so that the relationship does not leak. It also allows us to remove/hide and internal fields

Jump to

Keyboard shortcuts

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