generated

package
v0.0.0-...-a97d171 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.

Index

Constants

View Source
const (
	KeyHeaderScopes = "keyHeader.Scopes"
	KeyQueryScopes  = "keyQuery.Scopes"
)

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) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

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 ArticleSchema

type ArticleSchema struct {
	AppIcon   string `json:"app_icon"`
	AppId     int32  `json:"app_id"`
	Author    string `json:"author"`
	Contents  string `json:"contents"`
	Date      int64  `json:"date"`
	Feed      string `json:"feed"`
	FeedLabel string `json:"feed_label"`
	FeedType  int32  `json:"feed_type"`
	Icon      string `json:"icon"`
	Id        int64  `json:"id"`
	Title     string `json:"title"`
	Url       string `json:"url"`
}

ArticleSchema defines model for article-schema.

type ArticlesResponse

type ArticlesResponse struct {
	Articles   []ArticleSchema  `json:"articles"`
	Error      string           `json:"error"`
	Pagination PaginationSchema `json:"pagination"`
}

List of articles

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL     string
	BaseRouter  chi.Router
	Middlewares []MiddlewareFunc
}

type GameResponse

type GameResponse struct {
	Error string     `json:"error"`
	Game  GameSchema `json:"game"`
}

GameResponse defines model for game-response.

type GameSchema

type GameSchema struct {
	Categories      []StatSchema      `json:"categories"`
	Developers      []StatSchema      `json:"developers"`
	Genres          []StatSchema      `json:"genres"`
	Icon            string            `json:"icon"`
	Id              int               `json:"id"`
	MetacriticScore int32             `json:"metacritic_score"`
	Name            string            `json:"name"`
	PlayersMax      int               `json:"players_max"`
	PlayersWeekMax  int               `json:"players_week_max"`
	Prices          GameSchema_Prices `json:"prices"`
	Publishers      []StatSchema      `json:"publishers"`
	ReleaseDate     int64             `json:"release_date"`
	ReviewsNegative int               `json:"reviews_negative"`
	ReviewsPositive int               `json:"reviews_positive"`
	ReviewsScore    float64           `json:"reviews_score"`
	Tags            []StatSchema      `json:"tags"`
}

GameSchema defines model for game-schema.

type GameSchema_Prices

type GameSchema_Prices struct {
	AdditionalProperties map[string]ProductPriceSchema `json:"-"`
}

GameSchema_Prices defines model for GameSchema.Prices.

func (GameSchema_Prices) Get

func (a GameSchema_Prices) Get(fieldName string) (value ProductPriceSchema, found bool)

Getter for additional properties for GameSchema_Prices. Returns the specified element and whether it was found

func (GameSchema_Prices) MarshalJSON

func (a GameSchema_Prices) MarshalJSON() ([]byte, error)

Override default JSON handling for GameSchema_Prices to handle AdditionalProperties

func (*GameSchema_Prices) Set

func (a *GameSchema_Prices) Set(fieldName string, value ProductPriceSchema)

Setter for additional properties for GameSchema_Prices

func (*GameSchema_Prices) UnmarshalJSON

func (a *GameSchema_Prices) UnmarshalJSON(b []byte) error

Override default JSON handling for GameSchema_Prices to handle AdditionalProperties

type GamesResponse

type GamesResponse struct {
	Error      string           `json:"error"`
	Games      []GameSchema     `json:"games"`
	Pagination PaginationSchema `json:"pagination"`
}

List of apps, with pagination

type GetArticlesParams

type GetArticlesParams struct {
	Offset *OffsetParam            `json:"offset,omitempty"`
	Limit  *LimitParam             `json:"limit,omitempty"`
	Order  *GetArticlesParamsOrder `json:"order,omitempty"`
	Sort   *string                 `json:"sort,omitempty"`
	Ids    *[]int32                `json:"ids,omitempty"`
	AppIds *[]int32                `json:"app_ids,omitempty"`
	Feed   *string                 `json:"feed,omitempty"`
}

GetArticlesParams defines parameters for GetArticles.

type GetArticlesParamsOrder

type GetArticlesParamsOrder string

GetArticlesParamsOrder defines parameters for GetArticles.

type GetGamesParams

type GetGamesParams struct {
	Offset     *OffsetParam         `json:"offset,omitempty"`
	Limit      *LimitParam          `json:"limit,omitempty"`
	Order      *GetGamesParamsOrder `json:"order,omitempty"`
	Sort       *string              `json:"sort,omitempty"`
	Ids        *[]int32             `json:"ids,omitempty"`
	Tags       *[]int32             `json:"tags,omitempty"`
	Genres     *[]int32             `json:"genres,omitempty"`
	Categories *[]int32             `json:"categories,omitempty"`
	Developers *[]int32             `json:"developers,omitempty"`
	Publishers *[]int32             `json:"publishers,omitempty"`
	Platforms  *[]string            `json:"platforms,omitempty"`
}

GetGamesParams defines parameters for GetGames.

type GetGamesParamsOrder

type GetGamesParamsOrder string

GetGamesParamsOrder defines parameters for GetGames.

type GetGroupsParams

type GetGroupsParams struct {
	Offset *OffsetParam          `json:"offset,omitempty"`
	Limit  *LimitParam           `json:"limit,omitempty"`
	Order  *GetGroupsParamsOrder `json:"order,omitempty"`
	Sort   *GetGroupsParamsSort  `json:"sort,omitempty"`
	Ids    *[]int64              `json:"ids,omitempty"`
}

GetGroupsParams defines parameters for GetGroups.

type GetGroupsParamsOrder

type GetGroupsParamsOrder string

GetGroupsParamsOrder defines parameters for GetGroups.

type GetGroupsParamsSort

type GetGroupsParamsSort string

GetGroupsParamsSort defines parameters for GetGroups.

type GetPackagesParams

type GetPackagesParams struct {
	Offset      *OffsetParam            `json:"offset,omitempty"`
	Limit       *LimitParam             `json:"limit,omitempty"`
	Order       *GetPackagesParamsOrder `json:"order,omitempty"`
	Sort        *GetPackagesParamsSort  `json:"sort,omitempty"`
	Ids         *[]int32                `json:"ids,omitempty"`
	BillingType *[]int32                `json:"billingType,omitempty"`
	LicenseType *[]int32                `json:"licenseType,omitempty"`
	Status      *[]int32                `json:"status,omitempty"`
}

GetPackagesParams defines parameters for GetPackages.

type GetPackagesParamsOrder

type GetPackagesParamsOrder string

GetPackagesParamsOrder defines parameters for GetPackages.

type GetPackagesParamsSort

type GetPackagesParamsSort string

GetPackagesParamsSort defines parameters for GetPackages.

type GetPlayersParams

type GetPlayersParams struct {
	Offset    *OffsetParam           `json:"offset,omitempty"`
	Limit     *LimitParam            `json:"limit,omitempty"`
	Order     *GetPlayersParamsOrder `json:"order,omitempty"`
	Sort      *GetPlayersParamsSort  `json:"sort,omitempty"`
	Continent *[]string              `json:"continent,omitempty"`
	Country   *[]string              `json:"country,omitempty"`
}

GetPlayersParams defines parameters for GetPlayers.

type GetPlayersParamsOrder

type GetPlayersParamsOrder string

GetPlayersParamsOrder defines parameters for GetPlayers.

type GetPlayersParamsSort

type GetPlayersParamsSort string

GetPlayersParamsSort defines parameters for GetPlayers.

type GroupSchema

type GroupSchema struct {
	Abbreviation  string  `json:"abbreviation"`
	AppId         int32   `json:"app_id"`
	Error         string  `json:"error"`
	Headline      string  `json:"headline"`
	Icon          string  `json:"icon"`
	Id            string  `json:"id"`
	Members       int32   `json:"members"`
	MembersInChat int32   `json:"members_in_chat"`
	MembersInGame int32   `json:"members_in_game"`
	MembersOnline int32   `json:"members_online"`
	Name          string  `json:"name"`
	Primaries     int32   `json:"primaries"`
	Trending      float32 `json:"trending"`
	Url           string  `json:"url"`
}

GroupSchema defines model for group-schema.

type GroupsResponse

type GroupsResponse struct {
	Error      string           `json:"error"`
	Groups     []GroupSchema    `json:"groups"`
	Pagination PaginationSchema `json:"pagination"`
}

List of groups

type LimitParam

type LimitParam int

LimitParam defines model for limit-param.

type MessageResponse

type MessageResponse MessageSchema

MessageResponse defines model for message-response.

type MessageSchema

type MessageSchema struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

MessageSchema defines model for message-schema.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type OffsetParam

type OffsetParam int

OffsetParam defines model for offset-param.

type OrderParamDesc

type OrderParamDesc string

OrderParamDesc defines model for order-param-desc.

const (
	Asc OrderParamDesc = "asc"

	Desc OrderParamDesc = "desc"
)

Defines values for OrderParamDesc.

type PackageSchema

type PackageSchema struct {
	Apps             []int32              `json:"apps"`
	AppsCount        int32                `json:"apps_count"`
	BillingType      string               `json:"billing_type"`
	Bundle           []int32              `json:"bundle"`
	ChangeId         int32                `json:"change_id"`
	ChangeNumberDate int64                `json:"change_number_date"`
	ComingSoon       bool                 `json:"coming_soon"`
	DepotIds         []int32              `json:"depot_ids"`
	Icon             string               `json:"icon"`
	Id               int32                `json:"id"`
	ImagePage        string               `json:"image_page"`
	LicenseType      string               `json:"license_type"`
	Name             string               `json:"name"`
	Platforms        []string             `json:"platforms"`
	Prices           PackageSchema_Prices `json:"prices"`
	ReleaseDate      string               `json:"release_date"`
	ReleaseDateUnix  int64                `json:"release_date_unix"`
	Status           string               `json:"status"`
}

PackageSchema defines model for package-schema.

type PackageSchema_Prices

type PackageSchema_Prices struct {
	AdditionalProperties map[string]ProductPriceSchema `json:"-"`
}

PackageSchema_Prices defines model for PackageSchema.Prices.

func (PackageSchema_Prices) Get

func (a PackageSchema_Prices) Get(fieldName string) (value ProductPriceSchema, found bool)

Getter for additional properties for PackageSchema_Prices. Returns the specified element and whether it was found

func (PackageSchema_Prices) MarshalJSON

func (a PackageSchema_Prices) MarshalJSON() ([]byte, error)

Override default JSON handling for PackageSchema_Prices to handle AdditionalProperties

func (*PackageSchema_Prices) Set

func (a *PackageSchema_Prices) Set(fieldName string, value ProductPriceSchema)

Setter for additional properties for PackageSchema_Prices

func (*PackageSchema_Prices) UnmarshalJSON

func (a *PackageSchema_Prices) UnmarshalJSON(b []byte) error

Override default JSON handling for PackageSchema_Prices to handle AdditionalProperties

type PackagesResponse

type PackagesResponse struct {
	Error      string           `json:"error"`
	Packages   []PackageSchema  `json:"packages"`
	Pagination PaginationSchema `json:"pagination"`
}

List of packages

type PaginationSchema

type PaginationSchema struct {
	Limit        int64 `json:"limit"`
	Offset       int64 `json:"offset"`
	PagesCurrent int64 `json:"pagesCurrent"`
	PagesTotal   int64 `json:"pagesTotal"`
	Total        int64 `json:"total"`
}

PaginationSchema defines model for pagination-schema.

func (*PaginationSchema) Fill

func (pagination *PaginationSchema) Fill(offset, limit, count int64)

type PlayerResponse

type PlayerResponse struct {
	Error  string       `json:"error"`
	Player PlayerSchema `json:"player"`
}

PlayerResponse defines model for player-response.

type PlayerSchema

type PlayerSchema struct {
	Avatar    string `json:"avatar"`
	Badges    int    `json:"badges"`
	Continent string `json:"continent"`
	Country   string `json:"country"`
	Games     int    `json:"games"`
	Groups    int    `json:"groups"`
	Id        string `json:"id"`
	Level     int    `json:"level"`
	Name      string `json:"name"`
	Playtime  int    `json:"playtime"`
	State     string `json:"state"`
	VanityUrl string `json:"vanity_url"`
}

PlayerSchema defines model for player-schema.

type PlayersResponse

type PlayersResponse struct {
	Error      string           `json:"error"`
	Pagination PaginationSchema `json:"pagination"`
	Players    []PlayerSchema   `json:"players"`
}

PlayersResponse defines model for players-response.

type ProductPriceSchema

type ProductPriceSchema struct {
	Currency        string `json:"currency"`
	DiscountPercent int32  `json:"discountPercent"`
	Final           int32  `json:"final"`
	Free            bool   `json:"free"`
	Individual      int32  `json:"individual"`
	Initial         int32  `json:"initial"`
}

ProductPriceSchema defines model for product-price-schema.

type ServerInterface

type ServerInterface interface {
	// List Articles
	// (GET /articles)
	GetArticles(w http.ResponseWriter, r *http.Request, params GetArticlesParams)
	// List Games
	// (GET /games)
	GetGames(w http.ResponseWriter, r *http.Request, params GetGamesParams)
	// Retrieve Game
	// (GET /games/{id})
	GetGamesId(w http.ResponseWriter, r *http.Request, id int32)
	// List games with similar owners
	// (GET /games/{id}/similar)
	GetGamesIdSimilar(w http.ResponseWriter, r *http.Request, id int32)
	// List Groups
	// (GET /groups)
	GetGroups(w http.ResponseWriter, r *http.Request, params GetGroupsParams)
	// List Packages
	// (GET /packages)
	GetPackages(w http.ResponseWriter, r *http.Request, params GetPackagesParams)
	// List Players
	// (GET /players)
	GetPlayers(w http.ResponseWriter, r *http.Request, params GetPlayersParams)
	// Retrieve Player
	// (GET /players/{id})
	GetPlayersId(w http.ResponseWriter, r *http.Request, id int64)
	// Update Player
	// (POST /players/{id})
	PostPlayersId(w http.ResponseWriter, r *http.Request, id int64)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetArticles

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

GetArticles operation middleware

func (*ServerInterfaceWrapper) GetGames

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

GetGames operation middleware

func (*ServerInterfaceWrapper) GetGamesId

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

GetGamesId operation middleware

func (*ServerInterfaceWrapper) GetGamesIdSimilar

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

GetGamesIdSimilar operation middleware

func (*ServerInterfaceWrapper) GetGroups

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

GetGroups operation middleware

func (*ServerInterfaceWrapper) GetPackages

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

GetPackages operation middleware

func (*ServerInterfaceWrapper) GetPlayers

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

GetPlayers operation middleware

func (*ServerInterfaceWrapper) GetPlayersId

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

GetPlayersId operation middleware

func (*ServerInterfaceWrapper) PostPlayersId

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

PostPlayersId operation middleware

type SimilarGameSchema

type SimilarGameSchema struct {
	AppId  int `json:"app_id"`
	Count  int `json:"count"`
	Order  int `json:"order"`
	Owners int `json:"owners"`
}

SimilarGameSchema defines model for similar-game-schema.

type SimilarGamesResponse

type SimilarGamesResponse struct {
	Error string              `json:"error"`
	Games []SimilarGameSchema `json:"games"`
}

List of apps, with pagination

type StatSchema

type StatSchema struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

StatSchema defines model for stat-schema.

Jump to

Keyboard shortcuts

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