gopher

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gopher

type Gopher struct {
	ID    string `json:"ID"`
	Name  string `json:"name,omitempty"`
	Image string `json:"image,omitempty"`
	Age   int    `json:"age,omitempty"`
}

Gopher defines the properties of a gopher to be listed

func New added in v0.3.0

func New(ID, name, image string, age int) *Gopher

New creates a gopher

type Repository added in v0.3.0

type Repository interface {
	// CreateGopher saves a given gopher
	CreateGopher(ctx context.Context, g *Gopher) error
	// FetchGophers return all gophers saved in storage
	FetchGophers(ctx context.Context) ([]Gopher, error)
	// DeleteGopher remove gopher with given ID
	DeleteGopher(ctx context.Context, ID string) error
	// UpdateGopher modify gopher with given ID and given new data
	UpdateGopher(ctx context.Context, ID string, g Gopher) error
	// FetchGopherByID returns the gopher with given ID
	FetchGopherByID(ctx context.Context, ID string) (*Gopher, error)
}

Repository provides access to the gopher storage

Directories

Path Synopsis
log
storage

Jump to

Keyboard shortcuts

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