server

package
v0.0.0-...-13edf98 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Connect(dbName string, dbAddress string) error
}

Database holds all the required functionality for the handler

type DatabaseHandle

type DatabaseHandle struct {
	DB *sqlx.DB
}

DatabaseHandle attempt to abstract all the low level functionality of dealing with the database connection

func (*DatabaseHandle) Connect

func (db *DatabaseHandle) Connect(dbAddress string) error

Connect attempts to connect to the providecd dbName and dbAddress

type KingRequest

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

type Server

type Server struct {
	DBHandle *DatabaseHandle
}

Server is the entry point for creating the handler for user game of thrones requests

func (*Server) ClashKings

func (s *Server) ClashKings(ctx context.Context, scenario *gotKings.Scenario) (result *gotKings.GOTResult, err error)

ClashKings attempts to make 2 kings attack each other which will determine what happens to them

func (*Server) GetCharacter

func (s *Server) GetCharacter(ctx context.Context, charReq *gotKings.CharacterReq) (charInfo *gotKings.CharacterInfo, err error)

GetCharacter returns information on a given king

func (*Server) GetHistory

func (s *Server) GetHistory(ctx context.Context, format *gotKings.BoolResult) (result *gotKings.ScenarioResult, err error)

GetHistory attempts to retreive the kings action history

func (*Server) MakeKing

func (s *Server) MakeKing(ctx context.Context, charInfo *gotKings.CharacterInfo) (success *gotKings.BoolResult, err error)

MakeKing is the entry to creating a new Westeros King

Jump to

Keyboard shortcuts

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