service

package
v0.0.0-...-b1ea8ad Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const VersionNumber = "0.3.5"

Variables

This section is empty.

Functions

func GetVersion

func GetVersion(ctx *Context)

func InStringArray

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

func InitServer

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

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       mgo.Role       `json:"role"`
	Email      string         `json:"email"`
	Status     mgo.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 mgo.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 []*processInfo

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) KillExecutingJob

func (j *Job) KillExecutingJob(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

Jump to

Keyboard shortcuts

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