requestjob

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 14 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-request-job

go-runner에서 사용할 수 있는 request Job입니다.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorCantCreateJob = errors.New("데이터를 처리할 수 없습니다")

ErrorCantCreateJob : 데이터를 처리할 수 없을 때 (생성할 수 없을 떄) 발생합니다.

View Source
var ErrorJSONFormat = errors.New("json format error")
View Source
var ErrorNoAuthorization = errors.New("권한이 없습니다")

ErrorNoAuthorization : 권한이 없는 경우 발생합니다.

Functions

This section is empty.

Types

type RequestJob

type RequestJob struct {
	ID         string  `json:"id"`
	Name       string  `json:"name"`
	Cron       string  `json:"cron"`
	Reqeust    request `json:"request"`
	Inactive   bool    `json:"inactive"`
	CreateDate string  `json:"createDate"`
	Admin      admin   `json:"admin"`
	Extra      extra   `json:"extra"`
}

func New

func New() *RequestJob

func NewByFile

func NewByFile(path, name, owner string) (*RequestJob, error)

NewByFile : File로 부터 Job 객체를 생성합니다.

func NewByJSON

func NewByJSON(data, owner string) (*RequestJob, error)

NewByJSON : json 데이터로 부터 Job 객체를 생성합니다.

func NewList

func NewList(path string) ([]*RequestJob, error)

NewList : 폴더에 있는 데이터를 모두 Job객체로 만들어 반환합니다.

func (*RequestJob) BodyToCompile

func (job *RequestJob) BodyToCompile(body string) string

BodyToCompile : body에 대한 추가적은 옵션이 필요하다면, 임베딩을 사용하세요.

func (*RequestJob) CreateID

func (job *RequestJob) CreateID() error

CreateID : ID를 생성합니다.

func (*RequestJob) GetDefaultOwner

func (job *RequestJob) GetDefaultOwner() string

BodyToCompile : 기본 관리자를 수정하려면, 임베딩을 사용하세요.

func (*RequestJob) GetID

func (job *RequestJob) GetID() string

GetID : Job ID를 반환합니다.

func (*RequestJob) GetOwner

func (job *RequestJob) GetOwner() string

GetOwner : owner 정보를 반환합니다.

func (*RequestJob) HasAdminAuthorization

func (job *RequestJob) HasAdminAuthorization(member string) bool

HasAdminAuthorization : Job를 관리자 수준까지 권한이 있는지 여부를 반한합니다.

func (*RequestJob) HasAuthorization

func (job *RequestJob) HasAuthorization(member string) bool

HasAuthorization : 주어진 멤버가 이 Job에 권한이 있는지 여부를 반환합니다.

func (*RequestJob) IsAvailability

func (job *RequestJob) IsAvailability() bool

IsAvailability : 데이터가 유효성이 존재하는 지 여부를 반환합니다.

func (*RequestJob) IsRun

func (job *RequestJob) IsRun(t time.Time) bool

IsRun : Job를 실행해야하는 타임인지 여부를 반환합니다.

func (*RequestJob) Remove

func (job *RequestJob) Remove(path string) error

Remove : Job를 삭제합니다.

func (*RequestJob) Run

func (job *RequestJob) Run() interface{}

Run : Job를 실행합니다.

func (*RequestJob) Save

func (job *RequestJob) Save(path string)

Save : Job를 파일로 저장합니다.

func (*RequestJob) SetOwner

func (job *RequestJob) SetOwner(member string)

SetOwner : Job의 주인을 설정합니다.

type ResponseData

type ResponseData struct {
	Code   int
	Status string
	Body   string
	Header string
}

ResponseData : request 이후 반환되는 데이터 포맷입니다.

Jump to

Keyboard shortcuts

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