web

package
v0.0.0-...-28b3ec9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop

func Loop(fn func(Engine) error) error

Loop loop engines

func Main

func Main(version string) error

Main main entry

func RandomBytes

func RandomBytes(n uint) ([]byte, error)

RandomBytes random bytes

func RandomStr

func RandomStr(n int) string

RandomStr randome string

func Register

func Register(ens ...Engine)

Register register engines

func Shell

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

Shell exec shell command

Types

type Engine

type Engine interface {
	Map(*inject.Graph) error
	Mount(*gin.Engine)
	Migrate(*gorm.DB)
	Seed()
	Worker()
	Shell() []cli.Command
}

Engine web engine

type Model

type Model struct {
	ID        uint      `gorm:"primary_key" json:"id"`
	CreatedAt time.Time `json:"updated_at"`
	UpdatedAt time.Time `json:"created_at"`
}

Model db model

type PasswordEncryptor

type PasswordEncryptor struct {
}

PasswordEncryptor password encryptor

func (*PasswordEncryptor) Equal

func (p *PasswordEncryptor) Equal(plain []byte, code string) (bool, error)

Equal compare

func (*PasswordEncryptor) Sum

func (p *PasswordEncryptor) Sum(plain []byte, num uint) (string, error)

Sum sha512 with salt

type TextEncryptor

type TextEncryptor struct {
	Cipher cipher.Block `inject:""`
}

TextEncryptor text encryptor

func (*TextEncryptor) Decode

func (p *TextEncryptor) Decode(buf []byte) ([]byte, error)

Decode decode buffer

func (*TextEncryptor) Encode

func (p *TextEncryptor) Encode(buf []byte) ([]byte, error)

Encode encode buffer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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