handler

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 13 Imported by: 0

README

go-runner-handler

go-runner 기반 JOB 처리를 위한 handler 입니다.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorAuthorization = errors.New("no authorization header provided")
View Source
var ErrorBearer = errors.New("could not find bearer token in authorization header")
View Source
var ErrorJob = errors.New("could not create job")

Functions

func ResponseCantRemoveJob

func ResponseCantRemoveJob(c *gin.Context)

ResponseCantRemoveJob : OS 문제로 인한 삭제가 불가능할 경우 발생합니다.

func ResponseCompleteRemoveJob

func ResponseCompleteRemoveJob(c *gin.Context)

ResponseCompleteRemoveJob : Job이 성공적으로 삭제되었을 경우 발생합니다.

func ResponseData

func ResponseData(c *gin.Context, data interface{})

ResponseData : 데이터를 전송해야하는 경우 발생합니다.

func ResponseMaintenance

func ResponseMaintenance(c *gin.Context)

ResponseMaintenance : 시스템 점검 중일 경우 메시지를 반환합니다.

func ResponseNoAuthorization

func ResponseNoAuthorization(c *gin.Context)

ResponseNoAuthorization : 권한이 없는 사용자가 요청했을 경우 발생합니다.

func ResponseNotFoundPage

func ResponseNotFoundPage(c *gin.Context)

ResponseNotFoundPage : 찾을 수 없는 페이지일 경우 발생합니다.

func ResposeNeedLogin

func ResposeNeedLogin(c *gin.Context)

ResposeNeedLogin : 로그인이 필요한 경우 발생합니다.

func ResposeParamsError

func ResposeParamsError(c *gin.Context)

ResposeParamsError : 파라미터에 오류가 있을 경우 발생합니다.

func ResposeServerError

func ResposeServerError(c *gin.Context)

ResposeServerError : 서버에 에러가 발생했을 경우 발생합니다.

Types

type AuthInterface added in v0.0.9

type AuthInterface interface {
	GetLoginRedirectURL() string
	GetUser(code string, user interface{}) error
}

type Handler

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

func (*Handler) Active

func (h *Handler) Active(c *gin.Context)

func (*Handler) AuthCallback

func (h *Handler) AuthCallback(c *gin.Context)

AuthCallback : 사용자 인증을 해서 세션에 저장합니다.

func (*Handler) DeleteJob

func (h *Handler) DeleteJob(c *gin.Context)

func (*Handler) GetHookID

func (h *Handler) GetHookID(c *gin.Context)

func (*Handler) GetJob

func (h *Handler) GetJob(c *gin.Context)

func (*Handler) GetJobList

func (h *Handler) GetJobList(c *gin.Context)

func (*Handler) GetLogs

func (h *Handler) GetLogs(c *gin.Context)

func (*Handler) Initialize added in v0.0.6

func (h *Handler) Initialize(options map[string]string, jobControl *JobControlInterface, auth *AuthInterface) *Handler

func (*Handler) Login

func (h *Handler) Login(c *gin.Context)

Login : 로그인 페이지로 이동시킵니다.

func (*Handler) ReHookID

func (h *Handler) ReHookID(c *gin.Context)

func (*Handler) UpdateJob

func (h *Handler) UpdateJob(c *gin.Context)

type JobControlInterface added in v0.0.7

type JobControlInterface interface {
	NewList(path string) ([]*JobInterface, error)
	NewByJSON(data, owner string) (*JobInterface, error)
	NewByFile(path, name, owner string) (*JobInterface, error)
}

type JobInterface added in v0.0.7

type JobInterface interface {
	HasAuthorization(userID string) bool
	HasAdminAuthorization(userID string) bool
	IsRun(t time.Time) bool
	GetID() string
	Run() interface{}
	Remove(path string) error
	Save(path string)
}

type ResponseJobList added in v0.0.4

type ResponseJobList struct {
	Owner  []*JobInterface `json:"owner"`
	Editor []*JobInterface `json:"editor"`
	Admin  []*JobInterface `json:"admin"`
}

type User

type User struct {
	ID string `json:"accountId"`
}

User : 사용자 정보

type UserConfig

type UserConfig struct {
	Hook string `json:"hook"`
}

Jump to

Keyboard shortcuts

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