countryapp

package
v0.0.0-...-16ef530 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the country domain.

func NewApp

func NewApp(countryBus *countrybus.Business) *App

NewApp constructs a country app API for use.

func NewAppWithAuth

func NewAppWithAuth(countryBus *countrybus.Business, ath *auth.Auth) *App

NewAppWithAuth constructs a country app API for use with auth support.

func (*App) Query

func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[Country], error)

Query retrieves a list of countries based on the filter, order, and page.

func (*App) QueryByID

func (a *App) QueryByID(ctx context.Context, id uuid.UUID) (Country, error)

QueryByID retrieves the country by the specified ID.

type Country

type Country struct {
	ID     string `json:"id"`
	Number int    `json:"number"`
	Name   string `json:"name"`
	Alpha2 string `json:"alpha_2"`
	Alpha3 string `json:"alpha_3"`
}

Country represents information about an individual country.

func (Country) Encode

func (app Country) Encode() ([]byte, string, error)

Encode implements the encoder interface.

type QueryParams

type QueryParams struct {
	Page    string
	Rows    string
	OrderBy string
	ID      string
	Name    string
	Alpha2  string
	Alpha3  string
}

Jump to

Keyboard shortcuts

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