web

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebApiConfig

type WebApiConfig struct {
	// Array of urls which would be whitelisted on CORS headers
	AuthorizedUrls []string
	// Recaptcha key (optional)
	RecaptchaKey *string
	// Path where database file should be stored
	DbPath string
}

Configuration fo the webserver

type WebComment

type WebComment struct {
	ID       int           `json:"id"`
	Uri      string        `json:"uri"`
	Body     string        `json:"body"`
	Author   *string       `json:"author"`
	Email    *string       `json:"email"`
	Replies  *[]WebComment `json:"replies"`
	Created  *time.Time    `json:"created"`
	Modified *time.Time    `json:"modified"`
	Likes    int64         `json:"likes"`
	Dislikes int64         `json:"dislikes"`
}

func (*WebComment) MarshalJSON

func (c *WebComment) MarshalJSON() ([]byte, error)

type WebCommentThread

type WebCommentThread struct {
	Count    int          `json:"count"`
	Comments []WebComment `json:"comments"`
}

type WebServer

type WebServer interface {
	ListenAndServe(addr string)
}

func NewWebApi

func NewWebApi(config *WebApiConfig) (WebServer, error)

Jump to

Keyboard shortcuts

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