web

package
v0.0.0-...-00e0705 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeHTML html
	TypeHTML = "html"
	// TypeMARKDOWN markdown
	TypeMARKDOWN = "markdown"
	// TypeTEXT text
	TypeTEXT = "text"
	// DateFormat date format
	DateFormat = "2006-01-02"
)
View Source
const (
	// PRODUCTION production mode
	PRODUCTION = "production"
)

Variables

View Source
var (
	// Version version
	Version string
	// BuildTime build time
	BuildTime string
	// Usage usage
	Usage string
	// Copyright copyright
	Copyright string
	// AuthorName author's name
	AuthorName string
	// AuthorEmail author's email
	AuthorEmail string
)

Functions

func ConfigAction

func ConfigAction(f cli.ActionFunc) cli.ActionFunc

ConfigAction read config at first

func FuncName

func FuncName(f interface{}) string

FuncName get func's name

func InjectAction

func InjectAction(f cli.ActionFunc) cli.ActionFunc

InjectAction open beans at first

func MODE

func MODE() string

MODE run mode

func Main

func Main(args ...string) error

Main entry

func RandomBytes

func RandomBytes(l int) ([]byte, error)

RandomBytes random bytes

func Register

func Register(args ...Plugin)

Register register plugins

func SECRET

func SECRET() ([]byte, error)

SECRET secret key 32-bits

func Shell

func Shell(cmd string, args ...string) error

Shell exec shell command

Types

type Jwt

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

Jwt jwt

func NewJwt

func NewJwt(key []byte, method crypto.SigningMethod) *Jwt

NewJwt new jwt

func (*Jwt) Parse

func (p *Jwt) Parse(r *http.Request) (jwt.Claims, error)

Parse parse

func (*Jwt) Sum

func (p *Jwt) Sum(cm jws.Claims, exp time.Duration) ([]byte, error)

Sum create jwt token

func (*Jwt) Validate

func (p *Jwt) Validate(buf []byte) (jwt.Claims, error)

Validate check jwt

type Plugin

type Plugin interface {
	// init beans
	Init(*inject.Graph) error
	// console commands
	Shell() []cli.Command
	// register
	Mount() error
}

Plugin plugin

type Security

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

Security security helper

func NewSecurity

func NewSecurity(key []byte) (*Security, error)

NewSecurity new security

func (*Security) Check

func (p *Security) Check(encode, plain []byte) bool

Check check hash

func (*Security) Decrypt

func (p *Security) Decrypt(buf []byte) ([]byte, error)

Decrypt decrypt

func (*Security) Encrypt

func (p *Security) Encrypt(buf []byte) ([]byte, error)

Encrypt encrypt

func (*Security) Hash

func (p *Security) Hash(plain []byte) ([]byte, error)

Hash ont-way encrypt

Directories

Path Synopsis
fs
s3

Jump to

Keyboard shortcuts

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