api

package
v0.0.0-...-bf7a4f5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBotStorageProxyHandler

func MakeBotStorageProxyHandler(p *BotStorageReverseProxy) func(w http.ResponseWriter, r *http.Request)

MakeBotStorageProxyHandler is the handler for the route that proxies a request to the botstorage

func MakeConiksProxyHandler

func MakeConiksProxyHandler(conf *config.Config) func(w http.ResponseWriter, r *http.Request)

MakeConiksProxyHandler is the handler for the route that proxies a Coniks request

func MakePublicKeyGETAllHandler

func MakePublicKeyGETAllHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)

MakePublicKeyGETAllHandler is the handler for the API to get all the public keys of an user

func MakePublicKeyGETHandler

func MakePublicKeyGETHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)

MakePublicKeyGETHandler is the handler for the API to get a public key from a specific user and deviceID

func MakePublicKeyPOSTHandler

func MakePublicKeyPOSTHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)

MakePublicKeyPOSTHandler is the handler for the API to save a public key This public key is associated to an username and a deviceID

func MakePublicKeyPUTHandler

func MakePublicKeyPUTHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)

MakePublicKeyPUTHandler is the handler for the API to update a public key from an username deviceID

Types

type BotStorageReverseProxy

type BotStorageReverseProxy struct {
	LocationPrefix string // The listening location path
	// contains filtered or unexported fields
}

BotStorageReverseProxy is a structure that contains the needed information for the proxy

func New

func New(listeningPath string, target string) *BotStorageReverseProxy

New creates a BotStorageReverseProxy given the ListeningPath and the target

func (*BotStorageReverseProxy) Handle

Handle checks the JWT and proxies the request to the botstorage

type PublicKey

type PublicKey struct {
	PK string `json:"pk"`
}

PublicKey represents a public key in a JSON object

type UserAllPK

type UserAllPK struct {
	Login string
	AllPK map[string]string
}

UserAllPK is the structure that contains all the public Keys of an user (one PK per device)

type UserPublicKey

type UserPublicKey struct {
	Login  string `json:"login"`
	Device string `json:"deviceID"`
	PK     string `json:"pk"`
}

UserPublicKey is the structure that contains the public key associate to an user and a device

Jump to

Keyboard shortcuts

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