api

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/discord-gophers/goapi-gen version v0.3.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface, opts ...ServerOption) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Ability

type Ability struct {
	Description *string `json:"description,omitempty"`
	Name        *string `json:"name,omitempty"`
}

Ability defines model for Ability.

type Allegiance

type Allegiance struct {
	ID            *string `bun:"id,pk" json:"_id,omitempty"`
	Description   *string `json:"description,omitempty"`
	GrandAlliance *string `json:"grand_alliance,omitempty"`
	MortalRealm   *string `json:"mortal_realm,omitempty"`
	Name          string  `json:"name"`
}

Allegiance defines model for Allegiance.

type Army

type Army struct {
	ID    *string `bun:"id,pk" json:"_id,omitempty"`
	Name  string  `json:"name"`
	Units []Unit  `json:"units,omitempty"`
}

Army defines model for Army.

type City

type City struct {
	ID          *string `bun:"id,pk" json:"_id,omitempty"`
	Description *string `json:"description,omitempty"`
	Name        *string `json:"name,omitempty"`
}

City defines model for City.

type DamageTable

type DamageTable struct {
	ID                 *string `bun:"id,pk" json:"_id,omitempty"`
	MinWoundsSuffered  *int64  `json:"min_wounds_suffered,omitempty"`
	Move               *string `json:"move,omitempty"`
	WoundTrackPosition *int64  `json:"wound_track_position,omitempty"`
}

DamageTable defines model for DamageTable.

type Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

Error defines model for Error.

type GetAllegiancesParams

type GetAllegiancesParams struct {
	// number of allegiances to return
	Limit *int `json:"limit,omitempty"`

	// number of allegiances to skip
	Offset *int `json:"offset,omitempty"`

	// name of allegiance to filter by
	Name *string `json:"name,omitempty"`

	// id of grand alliance to filter by
	GrandAlliance *string `json:"grand_alliance,omitempty"`
}

GetAllegiancesParams defines parameters for GetAllegiances.

type GetCitiesParams

type GetCitiesParams struct {
	// number of cities to return
	Limit *int `json:"limit,omitempty"`

	// number of cities to skip
	Offset *int `json:"offset,omitempty"`

	// name of city to filter by
	Name *string `json:"name,omitempty"`
}

GetCitiesParams defines parameters for GetCities.

type GetUnitsParams

type GetUnitsParams struct {
	// number of units to return
	Limit *int `json:"limit,omitempty"`

	// number of units to skip
	Offset *int `json:"offset,omitempty"`

	// name of unit to filter by
	Name *string `json:"name,omitempty"`

	// grand alliance of unit to filter by
	GrandAlliance *string `json:"grand_alliance,omitempty"`

	// grand strategy of unit to filter by
	GrandStrategy *string `json:"grand_strategy,omitempty"`

	// points of unit to filter by
	Points *int `json:"points,omitempty"`
}

GetUnitsParams defines parameters for GetUnits.

type GetWarscrollsParams

type GetWarscrollsParams struct {
	// number of warscrolls to return
	Limit *int `json:"limit,omitempty"`

	// number of warscrolls to skip
	Offset *int `json:"offset,omitempty"`

	// name of warscroll to filter by
	Name *string `json:"name,omitempty"`

	// points of warscroll to filter by
	Points *int `json:"points,omitempty"`

	// battlefield_role of warscroll to filter by
	BattlefieldRole *string `json:"battlefield_role,omitempty"`

	// size of warscroll to filter by
	Size *string `json:"size,omitempty"`

	// notes of warscroll to filter by
	Notes *string `json:"notes,omitempty"`
}

GetWarscrollsParams defines parameters for GetWarscrolls.

type GrandAlliance

type GrandAlliance struct {
	ID          *string `bun:",pk" json:"_id,omitempty"`
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`
}

GrandAlliance defines model for GrandAlliance.

type GrandStrategy

type GrandStrategy struct {
	ID          *string `bun:",pk" json:"_id,omitempty"`
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`
}

GrandStrategy defines model for GrandStrategy.

type Health

type Health struct {
	Status string `json:"status"`
}

Health defines model for Health.

type InvalidParamFormatError

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

func (InvalidParamFormatError) Error

func (err InvalidParamFormatError) Error() string

Error implements error.

func (InvalidParamFormatError) ParamName

func (err InvalidParamFormatError) ParamName() string

func (InvalidParamFormatError) Unwrap

func (err InvalidParamFormatError) Unwrap() error

type ParameterError

type ParameterError interface {
	error
	// ParamName is the name of the parameter that the error is referring to.
	ParamName() string
}

ParameterName is an interface that is implemented by error types that are relevant to a specific parameter.

type RequiredHeaderError

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

func (RequiredHeaderError) Error

func (err RequiredHeaderError) Error() string

Error implements error.

func (RequiredHeaderError) ParamName

func (err RequiredHeaderError) ParamName() string

type RequiredParamError

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

func (RequiredParamError) Error

func (err RequiredParamError) Error() string

Error implements error.

func (RequiredParamError) ParamName

func (err RequiredParamError) ParamName() string

func (RequiredParamError) Unwrap

func (err RequiredParamError) Unwrap() error

type Response

type Response struct {
	Code int
	// contains filtered or unexported fields
}

Response is a common response struct for all the API calls. A Response object may be instantiated via functions for specific operation responses. It may also be instantiated directly, for the purpose of responding with a single status code.

func GetAbilitiesForUnitByIDJSON200Response

func GetAbilitiesForUnitByIDJSON200Response(body []Ability) *Response

GetAbilitiesForUnitByIDJSON200Response is a constructor method for a GetAbilitiesForUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func GetAbilitiesForUnitByIDJSON404Response

func GetAbilitiesForUnitByIDJSON404Response(body Error) *Response

GetAbilitiesForUnitByIDJSON404Response is a constructor method for a GetAbilitiesForUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func GetAllegianceByIDJSON200Response

func GetAllegianceByIDJSON200Response(body Allegiance) *Response

GetAllegianceByIDJSON200Response is a constructor method for a GetAllegianceByID response. A *Response is returned with the configured status code and content type from the spec.

func GetAllegianceByIDJSON404Response

func GetAllegianceByIDJSON404Response(body Error) *Response

GetAllegianceByIDJSON404Response is a constructor method for a GetAllegianceByID response. A *Response is returned with the configured status code and content type from the spec.

func GetAllegiancesJSON200Response

func GetAllegiancesJSON200Response(body []Allegiance) *Response

GetAllegiancesJSON200Response is a constructor method for a GetAllegiances response. A *Response is returned with the configured status code and content type from the spec.

func GetAllegiancesJSON404Response

func GetAllegiancesJSON404Response(body Error) *Response

GetAllegiancesJSON404Response is a constructor method for a GetAllegiances response. A *Response is returned with the configured status code and content type from the spec.

func GetArmiesJSON200Response

func GetArmiesJSON200Response(body []Army) *Response

GetArmiesJSON200Response is a constructor method for a GetArmies response. A *Response is returned with the configured status code and content type from the spec.

func GetArmiesJSON404Response

func GetArmiesJSON404Response(body Error) *Response

GetArmiesJSON404Response is a constructor method for a GetArmies response. A *Response is returned with the configured status code and content type from the spec.

func GetArmyByIDJSON200Response

func GetArmyByIDJSON200Response(body Army) *Response

GetArmyByIDJSON200Response is a constructor method for a GetArmyByID response. A *Response is returned with the configured status code and content type from the spec.

func GetArmyByIDJSON404Response

func GetArmyByIDJSON404Response(body Error) *Response

GetArmyByIDJSON404Response is a constructor method for a GetArmyByID response. A *Response is returned with the configured status code and content type from the spec.

func GetCitiesJSON200Response

func GetCitiesJSON200Response(body []City) *Response

GetCitiesJSON200Response is a constructor method for a GetCities response. A *Response is returned with the configured status code and content type from the spec.

func GetCitiesJSON404Response

func GetCitiesJSON404Response(body Error) *Response

GetCitiesJSON404Response is a constructor method for a GetCities response. A *Response is returned with the configured status code and content type from the spec.

func GetCityByIDJSON200Response

func GetCityByIDJSON200Response(body City) *Response

GetCityByIDJSON200Response is a constructor method for a GetCityByID response. A *Response is returned with the configured status code and content type from the spec.

func GetCityByIDJSON404Response

func GetCityByIDJSON404Response(body Error) *Response

GetCityByIDJSON404Response is a constructor method for a GetCityByID response. A *Response is returned with the configured status code and content type from the spec.

func GetDocsJSON404Response

func GetDocsJSON404Response(body Error) *Response

GetDocsJSON404Response is a constructor method for a GetDocs response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandAllianceByIDJSON200Response

func GetGrandAllianceByIDJSON200Response(body GrandAlliance) *Response

GetGrandAllianceByIDJSON200Response is a constructor method for a GetGrandAllianceByID response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandAllianceByIDJSON404Response

func GetGrandAllianceByIDJSON404Response(body Error) *Response

GetGrandAllianceByIDJSON404Response is a constructor method for a GetGrandAllianceByID response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandAlliancesJSON200Response

func GetGrandAlliancesJSON200Response(body []GrandAlliance) *Response

GetGrandAlliancesJSON200Response is a constructor method for a GetGrandAlliances response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandAlliancesJSON404Response

func GetGrandAlliancesJSON404Response(body Error) *Response

GetGrandAlliancesJSON404Response is a constructor method for a GetGrandAlliances response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandStrategiesJSON200Response

func GetGrandStrategiesJSON200Response(body []GrandStrategy) *Response

GetGrandStrategiesJSON200Response is a constructor method for a GetGrandStrategies response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandStrategiesJSON404Response

func GetGrandStrategiesJSON404Response(body Error) *Response

GetGrandStrategiesJSON404Response is a constructor method for a GetGrandStrategies response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandStrategyByIDJSON200Response

func GetGrandStrategyByIDJSON200Response(body GrandStrategy) *Response

GetGrandStrategyByIDJSON200Response is a constructor method for a GetGrandStrategyByID response. A *Response is returned with the configured status code and content type from the spec.

func GetGrandStrategyByIDJSON404Response

func GetGrandStrategyByIDJSON404Response(body Error) *Response

GetGrandStrategyByIDJSON404Response is a constructor method for a GetGrandStrategyByID response. A *Response is returned with the configured status code and content type from the spec.

func GetHealthzJSON200Response

func GetHealthzJSON200Response(body Health) *Response

GetHealthzJSON200Response is a constructor method for a GetHealthz response. A *Response is returned with the configured status code and content type from the spec.

func GetHealthzJSON404Response

func GetHealthzJSON404Response(body Error) *Response

GetHealthzJSON404Response is a constructor method for a GetHealthz response. A *Response is returned with the configured status code and content type from the spec.

func GetUnitByIDJSON200Response

func GetUnitByIDJSON200Response(body Unit) *Response

GetUnitByIDJSON200Response is a constructor method for a GetUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func GetUnitByIDJSON404Response

func GetUnitByIDJSON404Response(body Error) *Response

GetUnitByIDJSON404Response is a constructor method for a GetUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func GetUnitsJSON200Response

func GetUnitsJSON200Response(body []Unit) *Response

GetUnitsJSON200Response is a constructor method for a GetUnits response. A *Response is returned with the configured status code and content type from the spec.

func GetUnitsJSON404Response

func GetUnitsJSON404Response(body Error) *Response

GetUnitsJSON404Response is a constructor method for a GetUnits response. A *Response is returned with the configured status code and content type from the spec.

func GetWarscrollByIDJSON200Response

func GetWarscrollByIDJSON200Response(body Warscroll) *Response

GetWarscrollByIDJSON200Response is a constructor method for a GetWarscrollByID response. A *Response is returned with the configured status code and content type from the spec.

func GetWarscrollByIDJSON404Response

func GetWarscrollByIDJSON404Response(body Error) *Response

GetWarscrollByIDJSON404Response is a constructor method for a GetWarscrollByID response. A *Response is returned with the configured status code and content type from the spec.

func GetWarscrollsJSON200Response

func GetWarscrollsJSON200Response(body []Warscroll) *Response

GetWarscrollsJSON200Response is a constructor method for a GetWarscrolls response. A *Response is returned with the configured status code and content type from the spec.

func GetWarscrollsJSON404Response

func GetWarscrollsJSON404Response(body Error) *Response

GetWarscrollsJSON404Response is a constructor method for a GetWarscrolls response. A *Response is returned with the configured status code and content type from the spec.

func GetWeaponsForUnitByIDJSON200Response

func GetWeaponsForUnitByIDJSON200Response(body WeaponsGroup) *Response

GetWeaponsForUnitByIDJSON200Response is a constructor method for a GetWeaponsForUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func GetWeaponsForUnitByIDJSON404Response

func GetWeaponsForUnitByIDJSON404Response(body Error) *Response

GetWeaponsForUnitByIDJSON404Response is a constructor method for a GetWeaponsForUnitByID response. A *Response is returned with the configured status code and content type from the spec.

func (*Response) ContentType

func (resp *Response) ContentType(contentType string) *Response

ContentType is a builder method to override the default content type for a response.

func (*Response) MarshalJSON

func (resp *Response) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. This is used to only marshal the body of the response.

func (*Response) MarshalXML

func (resp *Response) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML implements the xml.Marshaler interface. This is used to only marshal the body of the response.

func (*Response) Render

func (resp *Response) Render(w http.ResponseWriter, r *http.Request) error

Render implements the render.Renderer interface. It sets the Content-Type header and status code based on the response definition.

func (*Response) Status

func (resp *Response) Status(code int) *Response

Status is a builder method to override the default status code for a response.

type ServerInterface

type ServerInterface interface {
	// Get all allegiances
	// (GET /allegiances)
	GetAllegiances(w http.ResponseWriter, r *http.Request, params GetAllegiancesParams) *Response
	// Get allegiance by id
	// (GET /allegiances/{id})
	GetAllegianceByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get all armies
	// (GET /armies)
	GetArmies(w http.ResponseWriter, r *http.Request) *Response
	// Get army by id
	// (GET /armies/{id})
	GetArmyByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get all cities
	// (GET /cities)
	GetCities(w http.ResponseWriter, r *http.Request, params GetCitiesParams) *Response
	// Get city by id
	// (GET /cities/{id})
	GetCityByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get API documentation
	// (GET /docs)
	GetDocs(w http.ResponseWriter, r *http.Request) *Response
	// Get all grand alliances
	// (GET /grand-alliances)
	GetGrandAlliances(w http.ResponseWriter, r *http.Request) *Response
	// Get grand alliance by id
	// (GET /grand-alliances/{id})
	GetGrandAllianceByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get all grand strategies
	// (GET /grand-strategies)
	GetGrandStrategies(w http.ResponseWriter, r *http.Request) *Response
	// Get grand strategy by id
	// (GET /grand-strategies/{id})
	GetGrandStrategyByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get health status
	// (GET /healthz)
	GetHealthz(w http.ResponseWriter, r *http.Request) *Response
	// Get all units
	// (GET /units)
	GetUnits(w http.ResponseWriter, r *http.Request, params GetUnitsParams) *Response
	// Get unit by id
	// (GET /units/{id})
	GetUnitByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get abilities for unit by id
	// (GET /units/{id}/abilities)
	GetAbilitiesForUnitByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get weapons for unit by id
	// (GET /units/{id}/weapons)
	GetWeaponsForUnitByID(w http.ResponseWriter, r *http.Request, id string) *Response
	// Get all warscrolls
	// (GET /warscrolls)
	GetWarscrolls(w http.ResponseWriter, r *http.Request, params GetWarscrollsParams) *Response
	// Get warscroll by id
	// (GET /warscrolls/{id})
	GetWarscrollByID(w http.ResponseWriter, r *http.Request, id string) *Response
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler          ServerInterface
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetAbilitiesForUnitByID

func (siw *ServerInterfaceWrapper) GetAbilitiesForUnitByID(w http.ResponseWriter, r *http.Request)

GetAbilitiesForUnitByID operation middleware

func (*ServerInterfaceWrapper) GetAllegianceByID

func (siw *ServerInterfaceWrapper) GetAllegianceByID(w http.ResponseWriter, r *http.Request)

GetAllegianceByID operation middleware

func (*ServerInterfaceWrapper) GetAllegiances

func (siw *ServerInterfaceWrapper) GetAllegiances(w http.ResponseWriter, r *http.Request)

GetAllegiances operation middleware

func (*ServerInterfaceWrapper) GetArmies

func (siw *ServerInterfaceWrapper) GetArmies(w http.ResponseWriter, r *http.Request)

GetArmies operation middleware

func (*ServerInterfaceWrapper) GetArmyByID

func (siw *ServerInterfaceWrapper) GetArmyByID(w http.ResponseWriter, r *http.Request)

GetArmyByID operation middleware

func (*ServerInterfaceWrapper) GetCities

func (siw *ServerInterfaceWrapper) GetCities(w http.ResponseWriter, r *http.Request)

GetCities operation middleware

func (*ServerInterfaceWrapper) GetCityByID

func (siw *ServerInterfaceWrapper) GetCityByID(w http.ResponseWriter, r *http.Request)

GetCityByID operation middleware

func (*ServerInterfaceWrapper) GetDocs

GetDocs operation middleware

func (*ServerInterfaceWrapper) GetGrandAllianceByID

func (siw *ServerInterfaceWrapper) GetGrandAllianceByID(w http.ResponseWriter, r *http.Request)

GetGrandAllianceByID operation middleware

func (*ServerInterfaceWrapper) GetGrandAlliances

func (siw *ServerInterfaceWrapper) GetGrandAlliances(w http.ResponseWriter, r *http.Request)

GetGrandAlliances operation middleware

func (*ServerInterfaceWrapper) GetGrandStrategies

func (siw *ServerInterfaceWrapper) GetGrandStrategies(w http.ResponseWriter, r *http.Request)

GetGrandStrategies operation middleware

func (*ServerInterfaceWrapper) GetGrandStrategyByID

func (siw *ServerInterfaceWrapper) GetGrandStrategyByID(w http.ResponseWriter, r *http.Request)

GetGrandStrategyByID operation middleware

func (*ServerInterfaceWrapper) GetHealthz

func (siw *ServerInterfaceWrapper) GetHealthz(w http.ResponseWriter, r *http.Request)

GetHealthz operation middleware

func (*ServerInterfaceWrapper) GetUnitByID

func (siw *ServerInterfaceWrapper) GetUnitByID(w http.ResponseWriter, r *http.Request)

GetUnitByID operation middleware

func (*ServerInterfaceWrapper) GetUnits

func (siw *ServerInterfaceWrapper) GetUnits(w http.ResponseWriter, r *http.Request)

GetUnits operation middleware

func (*ServerInterfaceWrapper) GetWarscrollByID

func (siw *ServerInterfaceWrapper) GetWarscrollByID(w http.ResponseWriter, r *http.Request)

GetWarscrollByID operation middleware

func (*ServerInterfaceWrapper) GetWarscrolls

func (siw *ServerInterfaceWrapper) GetWarscrolls(w http.ResponseWriter, r *http.Request)

GetWarscrolls operation middleware

func (*ServerInterfaceWrapper) GetWeaponsForUnitByID

func (siw *ServerInterfaceWrapper) GetWeaponsForUnitByID(w http.ResponseWriter, r *http.Request)

GetWeaponsForUnitByID operation middleware

type ServerOption

type ServerOption func(*ServerOptions)

func WithErrorHandler

func WithErrorHandler(handler func(w http.ResponseWriter, r *http.Request, err error)) ServerOption

func WithRouter

func WithRouter(r chi.Router) ServerOption

func WithServerBaseURL

func WithServerBaseURL(url string) ServerOption

type ServerOptions

type ServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	NumValues int
	// contains filtered or unexported fields
}

func (TooManyValuesForParamError) Error

func (err TooManyValuesForParamError) Error() string

Error implements error.

func (TooManyValuesForParamError) ParamName

func (err TooManyValuesForParamError) ParamName() string

type UnescapedCookieParamError

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

func (UnescapedCookieParamError) Error

func (err UnescapedCookieParamError) Error() string

Error implements error.

func (UnescapedCookieParamError) ParamName

func (err UnescapedCookieParamError) ParamName() string

func (UnescapedCookieParamError) Unwrap

func (err UnescapedCookieParamError) Unwrap() error

type Unit

type Unit struct {
	ID               *string       `bun:"id,pk" json:"_id,omitempty"`
	Abilities        []Ability     `json:"abilities,omitempty"`
	Bravery          *int64        `json:"bravery,omitempty"`
	Champion         *string       `json:"champion,omitempty"`
	CommandAbilities []Ability     `json:"command_abilities,omitempty"`
	DamageTable      []DamageTable `json:"damage_table,omitempty"`
	Description      *string       `json:"description,omitempty"`
	GrandAlliance    *string       `json:"grand_alliance,omitempty"`
	Keywords         []string      `json:"keywords,omitempty"`
	Magic            []Ability     `json:"magic,omitempty"`
	MeleeWeapons     []Weapon      `json:"melee_weapons,omitempty"`
	MissileWeapons   []Weapon      `json:"missile_weapons,omitempty"`
	Models           *int64        `json:"models,omitempty"`
	Move             *string       `json:"move,omitempty"`
	Name             string        `json:"name"`
	Points           *int64        `json:"points,omitempty"`
	Save             *int64        `json:"save,omitempty"`
	Size             *string       `json:"size,omitempty"`
	Wounds           *int64        `json:"wounds,omitempty"`
}

Unit defines model for Unit.

type UnmarshalingParamError

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

func (UnmarshalingParamError) Error

func (err UnmarshalingParamError) Error() string

Error implements error.

func (UnmarshalingParamError) ParamName

func (err UnmarshalingParamError) ParamName() string

func (UnmarshalingParamError) Unwrap

func (err UnmarshalingParamError) Unwrap() error

type Warscroll

type Warscroll struct {
	ID              *string        `bun:",pk" json:"_id,omitempty"`
	Allegiance      *Allegiance    `json:"allegiance,omitempty"`
	AllegianceID    *string        `json:"allegiance_id,omitempty"`
	BattlefieldRole *string        `json:"battlefield_role,omitempty"`
	GrandAlliance   *GrandAlliance `json:"grand_alliance,omitempty"`
	GrandAllianceID *string        `json:"grand_alliance_id,omitempty"`
	Name            *string        `json:"name,omitempty"`
	Notes           *string        `json:"notes,omitempty"`
	Points          *int64         `json:"points,omitempty"`
	Size            *int64         `json:"size,omitempty"`
}

Warscroll defines model for Warscroll.

type Weapon

type Weapon struct {
	ID      *string `bun:",pk" json:"_id,omitempty"`
	Attacks *string `json:"attacks,omitempty"`
	Damage  *string `json:"damage,omitempty"`
	Name    *string `json:"name,omitempty"`
	Range   *string `json:"range,omitempty"`
	Rend    *string `json:"rend,omitempty"`
	ToHit   *string `json:"to_hit,omitempty"`
	ToWound *string `json:"to_wound,omitempty"`
}

Weapon defines model for Weapon.

type WeaponsGroup

type WeaponsGroup struct {
	MeleeWeapons   []Weapon `json:"melee_weapons,omitempty"`
	MissileWeapons []Weapon `json:"missile_weapons,omitempty"`
}

WeaponsGroup defines model for WeaponsGroup.

Jump to

Keyboard shortcuts

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