web

package
Version: v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 EnsureJobLogIndex

func EnsureJobLogIndex()

func GetVersion

func GetVersion(ctx *Context)

func InStringArray

func InStringArray(k string, ss []string) bool

func InitServer

func InitServer() (*http.Server, error)

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 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 RunLogCleaner

func RunLogCleaner(cleanPeriod, expiration time.Duration) (close chan struct{})

func SubtractStringArray

func SubtractStringArray(a, b []string) (c []string)

返回存在于 a 且不存在于 b 中的元素集合

func UniqueStringArray

func UniqueStringArray(a []string) []string

Types

type Account

type Account struct {
	Role       cronsun.Role       `json:"role"`
	Email      string             `json:"email"`
	Status     cronsun.UserStatus `json:"status"`
	Session    bool               `json:"session"`
	CreateTime time.Time          `json:"createTime"`
}

type Administrator

type Administrator struct{}

func (*Administrator) AddAccount

func (this *Administrator) AddAccount(ctx *Context)

func (*Administrator) GetAccount

func (this *Administrator) GetAccount(ctx *Context)

func (*Administrator) GetAccountList

func (this *Administrator) GetAccountList(ctx *Context)

func (*Administrator) UpdateAccount

func (this *Administrator) UpdateAccount(ctx *Context)

type Authentication

type Authentication struct{}

func (*Authentication) DeleteAuthSession

func (this *Authentication) DeleteAuthSession(ctx *Context)

func (*Authentication) GetAuthSession

func (this *Authentication) GetAuthSession(ctx *Context)

func (*Authentication) SetPassword

func (this *Authentication) SetPassword(ctx *Context)

type BaseHandler

type BaseHandler struct {
	Ctx          map[string]interface{}
	BeforeHandle func(ctx *Context) (abort bool)
	Handle       func(ctx *Context)
}

func NewAdminAuthHandler

func NewAdminAuthHandler(f func(ctx *Context)) BaseHandler

func NewAuthHandler

func NewAuthHandler(f func(ctx *Context), reqRole cronsun.Role) BaseHandler

func NewBaseHandler

func NewBaseHandler(f func(ctx *Context)) BaseHandler

func (BaseHandler) ServeHTTP

func (b BaseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ByProcTime

type ByProcTime []*cronsun.Process

func (ByProcTime) Len

func (a ByProcTime) Len() int

func (ByProcTime) Less

func (a ByProcTime) Less(i, j int) bool

func (ByProcTime) Swap

func (a ByProcTime) Swap(i, j int)

type Configuration

type Configuration struct{}

func (*Configuration) Configuratios

func (cnf *Configuration) Configuratios(ctx *Context)

type Context

type Context struct {
	Data    map[interface{}]interface{}
	Session *session.Session

	R *http.Request
	W http.ResponseWriter
	// contains filtered or unexported fields
}

func (*Context) Done

func (ctx *Context) Done()

func (*Context) Todo

func (ctx *Context) Todo(f func())

type Info

type Info struct{}

func (*Info) Overview

func (inf *Info) Overview(ctx *Context)

type Job

type Job struct{}

func (*Job) BatchChangeJobStatus

func (j *Job) BatchChangeJobStatus(ctx *Context)

func (*Job) ChangeJobStatus

func (j *Job) ChangeJobStatus(ctx *Context)

func (*Job) DeleteJob

func (j *Job) DeleteJob(ctx *Context)

func (*Job) GetExecutingJob

func (j *Job) GetExecutingJob(ctx *Context)

func (*Job) GetGroups

func (j *Job) GetGroups(ctx *Context)

func (*Job) GetJob

func (j *Job) GetJob(ctx *Context)

func (*Job) GetJobNodes

func (j *Job) GetJobNodes(ctx *Context)

func (*Job) GetList

func (j *Job) GetList(ctx *Context)

func (*Job) JobExecute

func (j *Job) JobExecute(ctx *Context)

func (*Job) UpdateJob

func (j *Job) UpdateJob(ctx *Context)

type JobLog

type JobLog struct{}

func (*JobLog) GetDetail

func (jl *JobLog) GetDetail(ctx *Context)

func (*JobLog) GetList

func (jl *JobLog) GetList(ctx *Context)

type Node

type Node struct{}

func (*Node) DeleteGroup

func (n *Node) DeleteGroup(ctx *Context)

func (*Node) DeleteNode

func (n *Node) DeleteNode(ctx *Context)

DeleteNode force remove node (by ip) which state in offline or damaged.

func (*Node) GetGroupByGroupId

func (n *Node) GetGroupByGroupId(ctx *Context)

func (*Node) GetGroups

func (n *Node) GetGroups(ctx *Context)

func (*Node) GetNodes

func (n *Node) GetNodes(ctx *Context)

func (*Node) UpdateGroup

func (n *Node) UpdateGroup(ctx *Context)

type ProcFetchOptions

type ProcFetchOptions struct {
	Groups  []string
	NodeIds []string
	JobIds  []string
}

func (*ProcFetchOptions) Match

func (opt *ProcFetchOptions) Match(proc *cronsun.Process) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to