api

package
v0.0.0-...-04380b7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OK             = 200
	ACCESS_DENIED  = 403
	NOT_ALLOWED    = 405
	BAD_REQUEST    = 400
	INTERNAL_ERROR = 500
)

Status codes

Variables

This section is empty.

Functions

func Marshal

func Marshal(data interface{}) []byte

Marshal ...

Types

type AddData

type AddData struct {
	Data string `json:"data"`
}

type AddResponse

type AddResponse struct {
	Error string `json:"error"`
	State string `json:"state"`
}

type ApiConf

type ApiConf struct {
	Listen   string
	Db       *storage.DB
	GPGID    string
	Password string
}

func (ApiConf) Serve

func (conf ApiConf) Serve()

Server ...

type DeleteDataRequest

type DeleteDataRequest struct {
	Version string `json:"version"`
}

type ErrorResponse

type ErrorResponse struct {
	State string `json:"state"`
	Error string `json:"error"`
}

type ListResponse

type ListResponse struct {
	State    string         `json:"state"`
	Versions []storage.List `json:"versions"`
}

type PullRequest

type PullRequest struct {
	Version string `json:"version"`
}

type PurgeResponse

type PurgeResponse struct {
	State string `json:"state"`
	GPGID string `json:"gpgid"`
}

type RegRequest

type RegRequest struct {
	PubKey string `json:"pubkey"`
}

type RegResponse

type RegResponse struct {
	Error  string `json:"error"`
	UserID int    `json:"userid"`
}

Jump to

Keyboard shortcuts

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