api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoginEndpoint

func NewLoginEndpoint(store streamstore.Storage, privateKey interface{}) http.Handler

NewLoginEndpoint constructs a new handler instances

func NewSchemaEndpoint

func NewSchemaEndpoint(store streamstore.Storage) http.Handler

NewSchemaEndpoint constructs a new handler instances

func NewUserEndpoint

func NewUserEndpoint(store streamstore.Storage) http.Handler

NewUserEndpoint constructs a new handler instances

func NewVerifyEndpoint

func NewVerifyEndpoint(publicKey interface{}) http.Handler

NewVerifyEndpoint constructs a new handler instances

Types

type LoginEndpoint

type LoginEndpoint struct {
	// contains filtered or unexported fields
}

LoginEndpoint is an http.Handler which serves CRUD operations for schemas

func (*LoginEndpoint) ServeHTTP

func (endpoint *LoginEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the function needed to implement http.Handler

type LoginRequest

type LoginRequest struct {
	ID       string     `json:"id"`
	Password string     `json:"password"`
	Claims   jwt.Claims `json:"claims"`
}

LoginRequest is the struture of a Login Request (haha)

type SchemaEndpoint

type SchemaEndpoint struct {
	// contains filtered or unexported fields
}

SchemaEndpoint is an http.Handler which serves CRUD operations for schemas

func (*SchemaEndpoint) ServeHTTP

func (endpoint *SchemaEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the function needed to implement http.Handler

type UserEndpoint

type UserEndpoint struct {
	// contains filtered or unexported fields
}

UserEndpoint is an http.Handler which serves CRUD operations for users So this is CRUD + if payload is json hash the "password" field with bcrypt on all write operations (POST, PUT, PATCH) + if payload is json respect the "id" field as object key in POST requests

func (*UserEndpoint) ServeHTTP

func (endpoint *UserEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the function needed to implement http.Handler

type VerifyEndpoint

type VerifyEndpoint struct {
	// contains filtered or unexported fields
}

VerifyEndpoint is an http.Handler which serves CRUD operations for schemas

func (*VerifyEndpoint) ServeHTTP

func (endpoint *VerifyEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the function needed to implement http.Handler

Jump to

Keyboard shortcuts

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