Documentation ¶
Index ¶
Constants ¶
View Source
const (
PaginationLimit = 100
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { CEP string `json:"cep" db:"cep"` State string `json:"state" db:"state"` City string `json:"city" db:"location"` Neighborhood string `json:"neighborhood" db:"neighborhood"` Location string `json:"location" db:"location"` Children []*Address `json:"children" db:"children"` CreatedAt *time.Time `json:"created_at,omitempty,omitempty" db:"cep"` UpdatedAt *time.Time `json:"updated_at,omitempty,omitempty" db:"cep"` }
type ListParams ¶
type ListParams struct { State string Pagination *Pagination }
type Pagination ¶
Pagination is passed as a parameter to limit the total of rows.
func NewPagination ¶
func NewPagination(perPage, page int) *Pagination
type Storage ¶
type Storage interface { Close() Check(ctx context.Context) error CreateAddress(ctx context.Context, address *Address) error UpdateAddress(ctx context.Context, cep string, updater Updater) error GetAddress(ctx context.Context, cep string) (*Address, error) ListAddresses(ctx context.Context, params ListParams) ([]*Address, error) }
Click to show internal directories.
Click to hide internal directories.