logic

package
v0.0.0-...-cb2c959 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubjectClaim specifies the subject (user) of the jwt
	SubjectClaim = "sub"
	// ExpiresAtClaim specifies the time at which the jwt will expire
	ExpiresAtClaim = "exp"
	// IsAdminClaim specifies if the user is an admin user, and is prefixed with
	// the pigmice prefix for collision resistance
	IsAdminClaim = "pigmice_is_admin"
)

Variables

View Source
var ErrUnauthorized = fmt.Errorf("unauthorized user")

ErrUnauthorized is returned when the user being attempted to be authorized has either the wrong username or password.

Functions

func Authenticate

func Authenticate(username, password string, jwtSecret []byte, us user.Service) (string, error)

Authenticate gives a jwt signed string for a certain user.

func GetPhoto

func GetPhoto(team string, year int, ps photo.Service, consumer tba.Consumer) (string, error)

GetPhoto gets a photo from either the photo store if it exists there, or, fetches it from the TBA API and attempts to store the photo in the photo store.

Types

type TeamAnalysis

type TeamAnalysis struct {
	Team    string            `json:"team"`
	Notes   map[string]string `json:"notes"`
	Reports int               `json:"reports"`
	Stats   analysis.Results  `json:"stats"`
}

TeamAnalysis holds information about a team, and their analyzed performance.

func AllianceAnalysis

func AllianceAnalysis(eventKey, matchKey, color string, schema analysis.Schema, rs report.Service, as alliance.Service) ([]TeamAnalysis, error)

AllianceAnalysis gets information about how all teams at a certain event and match of a certain alliance performed.

func Analyze

func Analyze(eventKey string, teams []string, schema analysis.Schema, rs report.Service) ([]TeamAnalysis, error)

Analyze gets statistics on how a team performed.

func EventAnalysis

func EventAnalysis(eventKey string, schema analysis.Schema, rs report.Service) ([]TeamAnalysis, error)

EventAnalysis gets information about how all teams at an event performed.

Jump to

Keyboard shortcuts

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