api

package
v0.0.0-...-fcff741 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(h http.HandlerFunc) http.HandlerFunc

func Create

func Create(root string) http.Handler

func CreateDoorman

func CreateDoorman(w http.ResponseWriter, request *http.Request)

func CreateDoormanInDatabase

func CreateDoormanInDatabase(wab *doormen.DoormanDefinition) error

func GetAllDoormen

func GetAllDoormen(w http.ResponseWriter, request *http.Request)

func GetDoorman

func GetDoorman(w http.ResponseWriter, r *http.Request)

func GetDoormanStatus

func GetDoormanStatus(w http.ResponseWriter, r *http.Request)

func GetDormanState

func GetDormanState(w http.ResponseWriter, request *http.Request)

func GetServerSpecification

func GetServerSpecification(w http.ResponseWriter, request *http.Request)

func GetUser

func GetUser(req *http.Request) string

func SetUser

func SetUser(req *http.Request, user string)

func UpdateDoorman

func UpdateDoorman(w http.ResponseWriter, request *http.Request)

func UpdateDoormanInDatabase

func UpdateDoormanInDatabase(wab *doormen.DoormanDefinition) error

func Write400Error

func Write400Error(w http.ResponseWriter, err error)

func Write404Error

func Write404Error(w http.ResponseWriter)

func Write500Error

func Write500Error(w http.ResponseWriter, err error)

Types

type DBConnector

type DBConnector interface {
	Save(wab *doormen.DoormanDefinition) error
	Update(wab *doormen.DoormanDefinition) error
	Exists(wab *doormen.DoormanDefinition) bool
	ExistsId(id bson.ObjectId) bool
	GetAllDoormen() <-chan *doormen.DoormanId
	GetDoorman(id bson.ObjectId) (*doormen.DoormanDefinition, error)
	DeleteDoorman(id bson.ObjectId) error
}

type Publisher

type Publisher interface {
	Emit(doormanId bson.ObjectId, doorman shared.AsDoormanUpdatePayloader) error
	Init() error
}

Jump to

Keyboard shortcuts

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