web

package
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 added in v0.2.1

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 added in v0.2.1

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 added in v0.2.1

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 added in v0.2.1

func AssetNames() []string

AssetNames returns the names of the assets.

func EnsureJobLogIndex added in v0.3.1

func EnsureJobLogIndex()

func GetVersion

func GetVersion(ctx *Context)

func InStringArray

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

func InitServer added in v0.2.1

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

func MustAsset added in v0.2.1

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 added in v0.2.1

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets added in v0.2.1

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func RunLogCleaner added in v0.2.3

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 added in v0.2.1

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 added in v0.2.1

type Administrator struct{}

func (*Administrator) AddAccount added in v0.2.1

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

func (*Administrator) GetAccount added in v0.2.1

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

func (*Administrator) GetAccountList added in v0.2.1

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

func (*Administrator) UpdateAccount added in v0.2.1

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

type Authentication added in v0.2.1

type Authentication struct{}

func (*Authentication) DeleteAuthSession added in v0.2.1

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

func (*Authentication) GetAuthSession added in v0.2.1

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

func (*Authentication) SetPassword added in v0.2.1

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 added in v0.2.1

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

func NewAuthHandler added in v0.2.1

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

func NewBaseHandler added in v0.2.1

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 added in v0.2.1

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

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

func (*Context) Done added in v0.2.1

func (ctx *Context) Done()

func (*Context) Todo added in v0.2.1

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 added in v0.2.3

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 added in v0.2.2

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
y or Y : Canonical URL