commanders

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 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 Commander

type Commander struct {
	ID      uuid.UUID `json:"id"`
	WikiID  int       `json:"wikiID"`
	URL     string    `json:"url"`
	Name    string    `json:"name"`
	Summary string    `json:"summary"`
}

Commander represents a military leader involved in one or more battles in history

type CreationInput

type CreationInput struct {
	WikiID  int    `validate:"required"`
	URL     string `validate:"required,url"`
	Name    string `validate:"required"`
	Summary string
}

CreationInput is a struct that contains all of the data required to create a commander. This includes annotations required by validations

type FindManyQuery

type FindManyQuery struct {
	FactionID uuid.UUID
	Name      string
	Summary   string
}

FindManyQuery is used to refine the filters when finding many commanders

type FindOneQuery

type FindOneQuery struct {
	ID   uuid.UUID
	Name string
	URL  string
}

FindOneQuery is used to refine the filters when finding one commander

type Reader

type Reader interface {
	FindOne(query FindOneQuery) (Commander, error)
	FindMany(query FindManyQuery, page int) ([]Commander, int, error)
}

Reader is the interface through which commanders may be read

type Repository

type Repository interface {
	Reader
	Writer
}

Repository is the interface through which commanders may be read and written

type Writer

type Writer interface {
	CreateOne(data CreationInput) (uuid.UUID, error)
}

Writer is the interface through which commanders may be written

Jump to

Keyboard shortcuts

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