Back to godoc.org

Package models

v0.12.2
Latest Go to latest

The latest major version is .

Published: Aug 18, 2020 | License: MIT | Module: github.com/99designs/gqlgen

Index

Variables

var AllEpisode = []Episode{
	EpisodeNewhope,
	EpisodeEmpire,
	EpisodeJedi,
}
var AllLengthUnit = []LengthUnit{
	LengthUnitMeter,
	LengthUnitFoot,
}

func EncodeCursor

func EncodeCursor(i int) string

type Character

type Character interface {
	IsCharacter()
}

type CharacterFields

type CharacterFields struct {
	ID        string
	Name      string
	FriendIds []string
	AppearsIn []Episode
}

type Droid

type Droid struct {
	CharacterFields
	PrimaryFunction string
}

func (Droid) IsCharacter

func (Droid) IsCharacter()

func (Droid) IsSearchResult

func (Droid) IsSearchResult()

type Episode

type Episode string
const (
	EpisodeNewhope Episode = "NEWHOPE"
	EpisodeEmpire  Episode = "EMPIRE"
	EpisodeJedi    Episode = "JEDI"
)

func (Episode) IsValid

func (e Episode) IsValid() bool

func (Episode) MarshalGQL

func (e Episode) MarshalGQL(w io.Writer)

func (Episode) String

func (e Episode) String() string

func (*Episode) UnmarshalGQL

func (e *Episode) UnmarshalGQL(v interface{}) error

type FriendsConnection

type FriendsConnection struct {
	Ids  []string
	From int
	To   int
}

func (*FriendsConnection) PageInfo

func (f *FriendsConnection) PageInfo() PageInfo

func (*FriendsConnection) TotalCount

func (f *FriendsConnection) TotalCount() int

type FriendsEdge

type FriendsEdge struct {
	Cursor string    `json:"cursor"`
	Node   Character `json:"node"`
}

type Human

type Human struct {
	CharacterFields
	StarshipIds  []string
	HeightMeters float64
	Mass         float64
}

func (*Human) Height

func (h *Human) Height(unit LengthUnit) float64

func (Human) IsCharacter

func (Human) IsCharacter()

func (Human) IsSearchResult

func (Human) IsSearchResult()

type LengthUnit

type LengthUnit string
const (
	LengthUnitMeter LengthUnit = "METER"
	LengthUnitFoot  LengthUnit = "FOOT"
)

func (LengthUnit) IsValid

func (e LengthUnit) IsValid() bool

func (LengthUnit) MarshalGQL

func (e LengthUnit) MarshalGQL(w io.Writer)

func (LengthUnit) String

func (e LengthUnit) String() string

func (*LengthUnit) UnmarshalGQL

func (e *LengthUnit) UnmarshalGQL(v interface{}) error

type PageInfo

type PageInfo struct {
	StartCursor string `json:"startCursor"`
	EndCursor   string `json:"endCursor"`
	HasNextPage bool   `json:"hasNextPage"`
}

type Review

type Review struct {
	Stars      int
	Commentary *string
	Time       time.Time
}

type SearchResult

type SearchResult interface {
	IsSearchResult()
}

type Starship

type Starship struct {
	ID      string  `json:"id"`
	Name    string  `json:"name"`
	Length  float64 `json:"length"`
	History [][]int `json:"history"`
}

func (Starship) IsSearchResult

func (Starship) IsSearchResult()

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier