web

package module
v0.0.0-...-52f8398 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2016 License: MIT Imports: 21 Imported by: 1

README

A golang web framework

Example

See demo

Editor

Atom

Themes
apm install seti-ui
Plugs
  • go-plus
  • git-plus
  • react
  • atom-beautify
  • term3
  • autosave: enabled is true

Thanks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBase64

func FromBase64(s string) ([]byte, error)

FromBase64 string-to-bytes

func Load

func Load(file string, obj interface{}) error

Load 加载配置文件

func Loop

func Loop(fn func(en Engine) error) error

Loop loop for engines

func Main

func Main() error

Main entry

func Package

func Package(o interface{}, ds ...string) string

Package 获得包路径

func Random

func Random(n int) ([]byte, error)

Random random bytes

func Register

func Register(ens ...Engine)

Register registe engine

func Shell

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

Shell 终端命令操作

func Store

func Store(file string, obj interface{}) error

Store 写入配置文件

func ToBase64

func ToBase64(b []byte) string

ToBase64 bytes-to-string

func UUID

func UUID() string

UUID generate uuid v4 string

Types

type BytesSerial

type BytesSerial struct {
}

BytesSerial serial by gob

func (*BytesSerial) From

func (p *BytesSerial) From(d []byte, o interface{}) error

From bytes-to-object

func (*BytesSerial) To

func (p *BytesSerial) To(o interface{}) ([]byte, error)

To object-to-bytes

type Encryptor

type Encryptor struct {
	Cip cipher.Block
}

Encryptor encryptor

func (*Encryptor) Decode

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

Decode aes decoder

func (*Encryptor) Encode

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

Encode aes encoder

type Engine

type Engine interface {
	Map(inj inject.Injector) martini.Handler
	Mount(martini.Router)
	Migrate() martini.Handler
	Seed() martini.Handler
	Worker() martini.Handler
	Shell() []cli.Command
}

Engine web module

type Hashing

type Hashing interface {
	Sum([]byte) string
	Size() int
}

Hashing hashing

type JSONSerial

type JSONSerial struct {
}

JSONSerial json serial

func (*JSONSerial) From

func (p *JSONSerial) From(j []byte, o interface{}) error

From bytes-to-object

func (*JSONSerial) To

func (p *JSONSerial) To(o interface{}) ([]byte, error)

To object-to-bytes

type Md5

type Md5 struct {
}

Md5 md5

func (*Md5) Size

func (p *Md5) Size() int

Size size

func (*Md5) Sum

func (p *Md5) Sum(bs []byte) string

Sum sum

type Model

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

Model base model

type SaltHashing

type SaltHashing struct {
	H Hashing
}

SaltHashing Hashing with salt

func (*SaltHashing) Check

func (p *SaltHashing) Check(h string, b []byte) bool

Check check

func (*SaltHashing) Sum

func (p *SaltHashing) Sum(b []byte, l int) (string, error)

Sum append salt

type Serial

type Serial interface {
	From([]byte, interface{}) error
	To(interface{}) ([]byte, error)
}

Serial serial

type Sha512

type Sha512 struct {
}

Sha512 sha512

func (*Sha512) Size

func (p *Sha512) Size() int

Size size

func (*Sha512) Sum

func (p *Sha512) Sum(bs []byte) string

Sum sum

Directories

Path Synopsis
engines
cms

Jump to

Keyboard shortcuts

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