api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const CSRF_COOKIE_NAME = "kc4d018d7e07"

Variables

View Source
var ErrNotFound = errors.New("Not found")
View Source
var TEST_MODE = false

Functions

func NewAPIHandler

func NewAPIHandler(c Conf) (http.Handler, error)

Types

type Conf

type Conf struct {
	Url           string             `toml:"url"`
	Port          int                `toml:"port"`
	DB            string             `toml:"db"`
	DBType        string             `toml:"db_type"`
	MailSMTP      *ConfMailSMTP      `toml:"mail_smtp"`
	MailSparkpost *ConfMailSparkpost `toml:"mail_sparkpost"`
	MailFrom      string             `toml:"mail_from"`
	SessionRedis  *ConfSessionRedis  `toml:"session_redis"`
	Csrf          ConfCsrf           `toml:"csrf"`
}

type ConfCsrf

type ConfCsrf struct {
	HashKey  string `toml:"hash_key"`
	BlockKey string `toml:"block_key"`
}

type ConfMailSMTP

type ConfMailSMTP struct {
	Server   string `toml:"server_url"`
	User     string `toml:"user"`
	Password string `toml:"password"`
}

type ConfMailSparkpost

type ConfMailSparkpost struct {
	Key string `toml:"key"`
}

type ConfSessionRedis

type ConfSessionRedis struct {
	Server string `toml:"server"`
	DBId   int    `toml:"db_id"`
}

type StaticHandler

type StaticHandler struct {
	Dir       string
	IndexFile string
	// contains filtered or unexported fields
}

func NewStaticHandler

func NewStaticHandler() *StaticHandler

func (*StaticHandler) ServeHTTP

func (s *StaticHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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