api

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRouters

func AppendRouters(log logging.Logger, appendTo *mux.Router, routers ...Router) *mux.Router

AppendRouters creates a new router for any number of api routers

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func NewCredentialLogContext

func NewCredentialLogContext(credential *client.Credential) logging.LogContext

func NewIdentityLogContext

func NewIdentityLogContext(identity *client.Identity) logging.LogContext

func NewLoginLogContext

func NewLoginLogContext(login *client.Login) logging.LogContext

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

Types

type IdentityID

type IdentityID uuid.UUID

func (*IdentityID) String

func (id *IdentityID) String() string

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type TenantID

type TenantID uuid.UUID

func (*TenantID) String

func (id *TenantID) String() string

Jump to

Keyboard shortcuts

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