api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdminNamespacePrefix namespace for internal admin endpoints
	AdminNamespacePrefix = "/_a"
	// NamespacePrefix namespace for the CLI. Should not be used directly.
	NamespacePrefix = "/a/v1"

	// AuthenticationRoute is used to create and verify a token
	AuthenticationRoute = "/token"
	// ProductionRoute route to ProductionEndpoint
	ProductionRoute = "/new"
	// ResourceRoute route to ResourceEndpoint
	ResourceRoute = "/update/:parent/:kind/:id"
	// ListRoute route to ListProductionsEndpoint
	ListRoute = "/list"
	// BuildRoute route to BuildEndpoint
	BuildRoute = "/build"
)

Variables

This section is empty.

Functions

func BuildEndpoint

func BuildEndpoint(c *gin.Context)

BuildEndpoint starts the build of the feed

func ErrorResponse

func ErrorResponse(c *gin.Context, status int, err error)

ErrorResponse responds with an ErrorObject

func GetClientID

func GetClientID(c *gin.Context) (string, error)

GetClientID extracts the ClientID from the token

func HandleError

func HandleError(c *gin.Context, status int, e error)

HandleError is just a convenience method to avoid boiler-plate code

func ListProductionsEndpoint

func ListProductionsEndpoint(c *gin.Context)

ListProductionsEndpoint creates an new show and does all the background setup

func ProductionEndpoint

func ProductionEndpoint(c *gin.Context)

ProductionEndpoint creates an new show and does all the background setup

func RedirectToStorageEndpoint

func RedirectToStorageEndpoint(c *gin.Context)

RedirectToStorageEndpoint redirects requests to Cloud Storage

func ResourceEndpoint

func ResourceEndpoint(c *gin.Context)

ResourceEndpoint creates or updates a resource

func StandardResponse

func StandardResponse(c *gin.Context, status int, res interface{})

StandardResponse is the default way to respond to API requests

Types

type Header struct {
	Range           string `header:"Range"`
	UserAgent       string `header:"User-Agent"`
	Forwarded       string `header:"Forwarded"`
	XForwardedFor   string `header:"X-Forwarded-For"`
	XForwwardedHost string `header:"X-Forwarded-Host"`
	Referer         string `header:"Referer"`
}

Header extracts the relevant HTTP header stuff

Jump to

Keyboard shortcuts

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