app

package
v0.0.0-...-069cfaf Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Unlicense Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPMethodOverrideHeader is a commonly used
	// http header to override a request method.
	HTTPMethodOverrideHeader = "X-HTTP-Method-Override"
	// HTTPMethodOverrideFormKey is a commonly used
	// HTML form key to override a request method.
	HTTPMethodOverrideFormKey = "_method"
)

Variables

This section is empty.

Functions

func CommonMiddleware

func CommonMiddleware(next http.Handler) http.Handler

CommonMiddleware --Set content-type

func DefaultErrorHandler

func DefaultErrorHandler(w http.ResponseWriter, status int)

func ErrorLog

func ErrorLog(err error)

func InterceptHandler

func InterceptHandler(next http.Handler, errH ErrorHandler) http.Handler

func SendMail

func SendMail(f Feedback) (res int, out string, err error)

SendMail sends the email using Sendgrid

Types

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, int)

type Feedback

type Feedback struct {
	Name    string
	Email   string
	Message string
	URL     string
}

Feedback is feedback struct

type Host

type Host struct {
	Name     string
	Slug     string
	Host     string
	Template string
	Subs     map[string]Sub
}

type Message

type Message struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Message  string `json:"message"`
}

Define our message object

type OKNO

type OKNO struct {
	Hosts  map[string]Host
	Server *http.Server
}

func NewOKNO

func NewOKNO() *OKNO

func (*OKNO) GetHosts

func (o *OKNO) GetHosts() map[string]Host

func (*OKNO) GetParallelCoin

func (o *OKNO) GetParallelCoin()

func (*OKNO) Handler

func (o *OKNO) Handler() http.Handler

type PageData

type PageData struct {
	Title    string
	Host     Host
	Site     string
	HostSlug string
	Post     mod.Post
	Slug     string
	Section  string
	Template string
	Posts    []mod.Post
	Hosts    []Host
}

type Post

type Post struct {
	ID      string `schema:"id,required"`
	Title   string
	Slug    string
	Date    time.Time
	Excerpt string
	Active  bool
	Order   int
}

Post contains articles and pages used by the CMS

type Posts

type Posts []Post

func (Posts) Len

func (p Posts) Len() int

func (Posts) Less

func (p Posts) Less(i, j int) bool

func (Posts) Swap

func (p Posts) Swap(i, j int)

type Sub

type Sub struct {
	Name     string
	Slug     string
	Template string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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