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
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
Click to show internal directories.
Click to hide internal directories.