api

package
v0.0.0-...-3c0424e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port int
	Tier Tier
}

Config specifies the configuration for an API server instance.

func NewConfigFromEnv

func NewConfigFromEnv() (c Config, err error)

NewConfigFromEnv attempts to construct a new Config using data from environment variables.

type Server

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

Server is a wrapper for http.Server that exposes our app's endpoints.

func NewServer

func NewServer(logger *logrus.Logger, db app.DataStore, cv app.CommerceVendor,
	cfg Config) (*Server, error)

NewServer creates a new Server given a logger, data store, and configuration.

func (*Server) Start

func (svr *Server) Start() error

Start will call ListenAndServe on the internal http.Server and log the current configuration.

type Tier

type Tier string

Tier represents a different instance of this application.

const (
	// TierProduction represents the production tier of this app running
	// at app.teamxiv.space.
	TierProduction Tier = "prod"
	// TierDevelopment represents the development tier of this app running
	// at dev.teamxiv.space.
	TierDevelopment Tier = "dev"
	// TierLocal represents the local tier of this app running on your local
	// computer inside of Docker.
	TierLocal Tier = "local"
)

Jump to

Keyboard shortcuts

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