boundary

package
v0.0.0-...-e5b66af Latest Latest
Warning

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

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

Documentation

Overview

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

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

Index

Constants

View Source
const (
	BearerScopes = "bearer.Scopes"
)

Variables

View Source
var (
	GMT *time.Location
)

Functions

func Provide

func Provide(cfg config.Config, ctrl control.SessionController, version, commit string) *echo.Echo

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Aspect

type Aspect struct {
	// The unique id of the aspect
	Id string `json:"id"`

	// The aspect's name
	Name string `json:"name"`
}

Aspect defines model for Aspect.

type Character

type Character struct {
	Aspects []Aspect `json:"aspects"`

	// Non-negative number of Fate Points for the character
	FatePoints int `json:"fatePoints"`

	// The unique id of the character
	Id string `json:"id"`

	// The character's name
	Name string `json:"name"`

	// The unique id of the characters's owner
	OwnerId string        `json:"ownerId"`
	Type    CharacterType `json:"type"`
}

Character defines model for Character.

type CharacterType

type CharacterType string

CharacterType defines model for Character.Type.

const (
	CharacterTypeNPC CharacterType = "NPC"
	CharacterTypePC  CharacterType = "PC"
)

Defines values for CharacterType.

type CreateAspect

type CreateAspect struct {
	// The aspect's name
	Name string `json:"name"`
}

CreateAspect defines model for CreateAspect.

type CreateAspectJSONBody

type CreateAspectJSONBody = CreateAspect

CreateAspectJSONBody defines parameters for CreateAspect.

type CreateAspectJSONRequestBody

type CreateAspectJSONRequestBody = CreateAspectJSONBody

CreateAspectJSONRequestBody defines body for CreateAspect for application/json ContentType.

type CreateCharacter

type CreateCharacter struct {
	// The character's name
	Name string              `json:"name"`
	Type CreateCharacterType `json:"type"`
}

CreateCharacter defines model for CreateCharacter.

type CreateCharacterAspectJSONBody

type CreateCharacterAspectJSONBody = CreateAspect

CreateCharacterAspectJSONBody defines parameters for CreateCharacterAspect.

type CreateCharacterAspectJSONRequestBody

type CreateCharacterAspectJSONRequestBody = CreateCharacterAspectJSONBody

CreateCharacterAspectJSONRequestBody defines body for CreateCharacterAspect for application/json ContentType.

type CreateCharacterJSONBody

type CreateCharacterJSONBody = CreateCharacter

CreateCharacterJSONBody defines parameters for CreateCharacter.

type CreateCharacterJSONRequestBody

type CreateCharacterJSONRequestBody = CreateCharacterJSONBody

CreateCharacterJSONRequestBody defines body for CreateCharacter for application/json ContentType.

type CreateCharacterType

type CreateCharacterType string

CreateCharacterType defines model for CreateCharacter.Type.

const (
	CreateCharacterTypeNPC CreateCharacterType = "NPC"
	CreateCharacterTypePC  CreateCharacterType = "PC"
)

Defines values for CreateCharacterType.

type CreateSession

type CreateSession struct {
	// Human readable title of the session
	Title string `json:"title"`
}

CreateSession defines model for CreateSession.

type CreateSessionJSONBody

type CreateSessionJSONBody = CreateSession

CreateSessionJSONBody defines parameters for CreateSession.

type CreateSessionJSONRequestBody

type CreateSessionJSONRequestBody = CreateSessionJSONBody

CreateSessionJSONRequestBody defines body for CreateSession for application/json ContentType.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Error

type Error struct {
	// error code
	Code int `json:"code"`

	// Human-readable error message
	Error string `json:"error"`
}

Error defines model for Error.

type ServerInterface

type ServerInterface interface {
	// Create an authorization token for the client
	// (POST /auth/new)
	CreateAuthToken(ctx echo.Context) error
	// Create a new session
	// (POST /sessions)
	CreateSession(ctx echo.Context) error
	// Get the session with the given id
	// (GET /sessions/{id})
	GetSession(ctx echo.Context, id string) error
	// Create a new global aspect.
	// (POST /sessions/{id}/aspects)
	CreateAspect(ctx echo.Context, id string) error
	// Delete an aspect.
	// (DELETE /sessions/{id}/aspects/{aspectId})
	DeleteAspect(ctx echo.Context, id string, aspectId string) error
	// Create a new character.
	// (POST /sessions/{id}/characters)
	CreateCharacter(ctx echo.Context, id string) error
	// Delete a character.
	// (DELETE /sessions/{id}/characters/{characterId})
	DeleteCharacter(ctx echo.Context, id string, characterId string) error
	// Create a new aspect bound to a specific character.
	// (POST /sessions/{id}/characters/{characterId}/aspects)
	CreateCharacterAspect(ctx echo.Context, id string, characterId string) error
	// Update Fate Points for the character
	// (PUT /sessions/{id}/characters/{characterId}/fatepoints)
	UpdateFatePoints(ctx echo.Context, id string, characterId string) error
	// Retrieve version information
	// (GET /version-info)
	GetVersionInfo(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateAspect

func (w *ServerInterfaceWrapper) CreateAspect(ctx echo.Context) error

CreateAspect converts echo context to params.

func (*ServerInterfaceWrapper) CreateAuthToken

func (w *ServerInterfaceWrapper) CreateAuthToken(ctx echo.Context) error

CreateAuthToken converts echo context to params.

func (*ServerInterfaceWrapper) CreateCharacter

func (w *ServerInterfaceWrapper) CreateCharacter(ctx echo.Context) error

CreateCharacter converts echo context to params.

func (*ServerInterfaceWrapper) CreateCharacterAspect

func (w *ServerInterfaceWrapper) CreateCharacterAspect(ctx echo.Context) error

CreateCharacterAspect converts echo context to params.

func (*ServerInterfaceWrapper) CreateSession

func (w *ServerInterfaceWrapper) CreateSession(ctx echo.Context) error

CreateSession converts echo context to params.

func (*ServerInterfaceWrapper) DeleteAspect

func (w *ServerInterfaceWrapper) DeleteAspect(ctx echo.Context) error

DeleteAspect converts echo context to params.

func (*ServerInterfaceWrapper) DeleteCharacter

func (w *ServerInterfaceWrapper) DeleteCharacter(ctx echo.Context) error

DeleteCharacter converts echo context to params.

func (*ServerInterfaceWrapper) GetSession

func (w *ServerInterfaceWrapper) GetSession(ctx echo.Context) error

GetSession converts echo context to params.

func (*ServerInterfaceWrapper) GetVersionInfo

func (w *ServerInterfaceWrapper) GetVersionInfo(ctx echo.Context) error

GetVersionInfo converts echo context to params.

func (*ServerInterfaceWrapper) UpdateFatePoints

func (w *ServerInterfaceWrapper) UpdateFatePoints(ctx echo.Context) error

UpdateFatePoints converts echo context to params.

type Session

type Session struct {
	Aspects    []Aspect    `json:"aspects"`
	Characters []Character `json:"characters"`

	// The unique id of the session
	Id string `json:"id"`

	// The unique id of the session's owner
	OwnerId string `json:"ownerId"`

	// Human readable title of the session
	Title string `json:"title"`
}

Session defines model for Session.

type UpdateFatePoints

type UpdateFatePoints struct {
	// Number to modify character's Fate Points (negative or positive)
	FatePointsDelta int `json:"fatePointsDelta"`
}

UpdateFatePoints defines model for UpdateFatePoints.

type UpdateFatePointsJSONBody

type UpdateFatePointsJSONBody = UpdateFatePoints

UpdateFatePointsJSONBody defines parameters for UpdateFatePoints.

type UpdateFatePointsJSONRequestBody

type UpdateFatePointsJSONRequestBody = UpdateFatePointsJSONBody

UpdateFatePointsJSONRequestBody defines body for UpdateFatePoints for application/json ContentType.

type VersionInfo

type VersionInfo struct {
	// The version string of the API specs.
	ApiVersion string `json:"apiVersion"`

	// Git commit hash of the backend code.
	Commit string `json:"commit"`

	// The version string of the backend component.
	Version string `json:"version"`
}

VersionInfo defines model for VersionInfo.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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