vegeta

package module
v0.0.0-...-03e7feb Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: GPL-3.0 Imports: 39 Imported by: 3

README

vegeta

Project to collect large amounts of vegetable data using IoT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogDir  = "log"
	LogName = "vegeta_log"
)

Functions

func AddTag

func AddTag() echo.HandlerFunc

func Admin

func Admin() echo.HandlerFunc

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func Auth

func Auth() echo.HandlerFunc

func DeleteTag

func DeleteTag() echo.HandlerFunc

Public JSON API

func GetDataList

func GetDataList() echo.HandlerFunc

func GetTagList

func GetTagList() echo.HandlerFunc

func Index

func Index() echo.HandlerFunc

func JSONCreateUser

func JSONCreateUser() echo.HandlerFunc

func JSONDeleteUser

func JSONDeleteUser() echo.HandlerFunc

func JSONEditUser

func JSONEditUser() echo.HandlerFunc

func JSONTagsData

func JSONTagsData() echo.HandlerFunc

func Login

func Login() echo.HandlerFunc

func Logout

func Logout() echo.HandlerFunc

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func MyPage

func MyPage() echo.HandlerFunc

func PostData

func PostData() echo.HandlerFunc

func PostTag

func PostTag() echo.HandlerFunc

func ReRegisterPassword

func ReRegisterPassword() echo.HandlerFunc

func RegenerateToken

func RegenerateToken() echo.HandlerFunc

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Settings

func Settings() echo.HandlerFunc

func UnwrapErrors

func UnwrapErrors(err error) (int, error)

UnwrapErrors get important message from wrapped error message

Types

type Context

type Context struct {
	echo.Context
	DB  *gorm.DB
	Zap *zap.Logger
}

func (*Context) BindValidate

func (c *Context) BindValidate(i interface{}) error

func (*Context) CreateAPIToken

func (c *Context) CreateAPIToken(username string) (string, error)

func (*Context) GetUserStatus

func (c *Context) GetUserStatus() html.Args

type Options

type Options struct {
	Help    bool `short:"h" long:"help" description:"show this message"`
	Version bool `short:"v" long:"version" description:"print the version"`

	Port       int  `short:"p" long:"port" description:"specify the port number" default:"3000"`
	Migrate    bool `long:"migrate" description:"migrate mysql for this program"`
	StackTrace bool `long:"trace" description:"display detail error messages"`
}

Options struct for parse command line arguments

type Validator

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

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

type Vegeta

type Vegeta struct {
	Options
	*echo.Echo
	*zap.Logger
	DB *gorm.DB
	// contains filtered or unexported fields
}

func New

func New() *Vegeta

func (*Vegeta) ErrorHandler

func (v *Vegeta) ErrorHandler(err error, c echo.Context)

func (*Vegeta) LogHandler

func (v *Vegeta) LogHandler() echo.MiddlewareFunc

func (*Vegeta) NewContext

func (v *Vegeta) NewContext(ctx echo.Context) (*Context, error)

func (*Vegeta) Run

func (v *Vegeta) Run() int

Directories

Path Synopsis
app
cli
Code generated by hero.
Code generated by hero.
internal

Jump to

Keyboard shortcuts

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