api

package
v0.0.0-...-309cb8d Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	DocsPrefix = `docs`
	AuthPrefix = `auth`

	RestApiPrefix              = `rest`
	ExportPrefix               = `admin/export`
	ImportPrefix               = `admin/import`
	ResetPrefix                = `admin/reset`
	RotateInstanceSecretPrefix = `admin/rotate_instance_secret`
)
View Source
const (
	SignatureHeader = `X-Karma-Signature`
	CodecHeader     = `X-Karma-Codec`
	SecretHeader    = `X-Karma-Secret`
)
View Source
const MaxPayloadBytes = 8 * 1024 * 1024 // 8MB
View Source
const (
	MinDatabaseSecretLength = 512
)

Variables

View Source
var (
	ContextKeyCodec    = contextKeyCodecT{}
	ContextKeyDatabase = contextKeyDatabaseT{}
	ContextKeyUserId   = contextKeyUserIdT{}
)
View Source
var AuthRequestModel = mdl.StructFromMap(map[string]mdl.Model{
	"username": mdl.String{},
	"password": mdl.String{},
})

Functions

func AuthHttpHandler

func AuthHttpHandler(rw http.ResponseWriter, rq *http.Request)

func ExportHttpHandler

func ExportHttpHandler(rw http.ResponseWriter, rq *http.Request)

func HttpHandler

func HttpHandler(rw http.ResponseWriter, rq *http.Request)

func ImportHttpHandler

func ImportHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RandIv

func RandIv(ln int) []byte

func ResetHttpHandler

func ResetHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiDeleteHttpHandler

func RestApiDeleteHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiDeleteResourceHttpHandler

func RestApiDeleteResourceHttpHandler(resource string, rw http.ResponseWriter, rq *http.Request)

DELETE /{resource}

func RestApiDeleteResourceIdHttpHandler

func RestApiDeleteResourceIdHttpHandler(resource, id string, rw http.ResponseWriter, rq *http.Request)

DELETE /{resource}/{id}

func RestApiGetHttpHandler

func RestApiGetHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiGetResourceHttpHandler

func RestApiGetResourceHttpHandler(resource string, rw http.ResponseWriter, rq *http.Request)

GET /{resource} query arguments: - length int amount of results - offset int amount to skip - metadata bool whether to metarialize TODO: sort

func RestApiGetResourceIdHttpHandler

func RestApiGetResourceIdHttpHandler(resource, id string, rw http.ResponseWriter, rq *http.Request)

GET /{resource}/{id}

func RestApiHttpHandler

func RestApiHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiPostHttpHandler

func RestApiPostHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiPostResourceHttpHandler

func RestApiPostResourceHttpHandler(resource string, rw http.ResponseWriter, rq *http.Request)

POST /{resource}

func RestApiPutHttpHandler

func RestApiPutHttpHandler(rw http.ResponseWriter, rq *http.Request)

func RestApiPutResourceIdHttpHandler

func RestApiPutResourceIdHttpHandler(resource, id string, rw http.ResponseWriter, rq *http.Request)

PUT /{resource}/{id}

func RotateInstanceSecretHttpHandler

func RotateInstanceSecretHttpHandler(rw http.ResponseWriter, rq *http.Request)

Types

type Payload

type Payload []byte

type TxType

type TxType byte
const (
	TxTypeNone TxType = iota
	TxTypeRead
	TxTypeWrite
)

Jump to

Keyboard shortcuts

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