openapi

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP method
	HTTPGetMethod = "GET"

	// job default conf
	DefaultXattrsPageSize           = 5
	DefaultXattrsConsumerSize       = 5
	DefaultXattrsQueueSize          = 10
	DefaultXattrsDispatcherSize     = 5
	DefaultXattrsGlobalConsumerSize = 1000

	// time expression type
	CronType        = 1   // cron
	FixRateType     = 3   // fixed frequency
	SecondDelayType = 4   // second level delay
	OneTimeType     = 5   // one-time tasks
	APIType         = 100 // api type

	// execute mode
	ExecModeStandalone = "standalone"
	ExecModeBroadcast  = "broadcast"
	ExecModeParallel   = "parallel"
	ExecModeGrid       = "grid"
	ExecModeBatch      = "batch"

	// openAPI special header
	TIME_STAMP_HEADER       = "openapi-timestamp"
	SIGNATURE_HEADER        = "openapi-signature"
	GROUPID_HEADER          = "openapi-groupid"
	NAMESPACE_KEY_HEADER    = "schedulerx-namespace"
	NAMESPACE_SOURCE_HEADER = "schedulerx-namespace-source"
	CREATE_NAMESPACE_HEADER = "openapi-create-namespace"
	CREATE_GROUP_HEADER     = "openapi-create-group"
	LIST_NAMESPACES_HEADER  = "openapi-list-namespaces"
	LIST_GROUPS_HEADER      = "openapi-list-groups"
	ADMIN_USERS             = "app.admin.users"
	ENV                     = "app.env"
	ENV_NETWORK             = "app.env.network"
)

Variables

This section is empty.

Functions

func InitOpenAPIClient

func InitOpenAPIClient(cli *Client)

Types

type BaseRequest

type BaseRequest interface {
	// contains filtered or unexported methods
}

func NewDefaultBaseRequest

func NewDefaultBaseRequest() BaseRequest

type Client

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

func GetOpenAPIClient

func GetOpenAPIClient() *Client

GetOpenAPIClient first executes InitOpenAPIClient and then calls it, otherwise it returns nil

func NewClient

func NewClient(opts ...Option) *Client

func (*Client) CreateHTTPJob

func (c *Client) CreateHTTPJob(req *CreateHTTPJobRequest) (int64, error)

CreateHTTPJob create http job

func (*Client) CreateJob

func (c *Client) CreateJob(req *CreateJavaJobRequest) (int64, error)

CreateJob create java type job

func (*Client) DeleteJob

func (c *Client) DeleteJob(req *DeleteJobRequest) error

DeleteJob delete job

func (*Client) DisableJob

func (c *Client) DisableJob(req *DisableJobRequest) error

func (*Client) Domain

func (c *Client) Domain() string

func (*Client) EnableJob

func (c *Client) EnableJob(req *EnableJobRequest) error

func (*Client) ExecJob

func (c *Client) ExecJob(req *DeleteJobRequest) error

func (*Client) GetJobInstance

func (c *Client) GetJobInstance(req *GetJobInstanceRequest) error

func (*Client) GetJobInstanceList

func (c *Client) GetJobInstanceList(req *GetJobInstanceListRequest) error

func (*Client) HttpClient

func (c *Client) HttpClient() *http.Client

func (*Client) KillJobInstance

func (c *Client) KillJobInstance(req *KillJobInstanceRequest) error

func (*Client) Namespace

func (c *Client) Namespace() string

func (*Client) NamespaceSource

func (c *Client) NamespaceSource() string

func (*Client) SetDomain

func (c *Client) SetDomain()

func (*Client) UpdateJob

func (c *Client) UpdateJob(req *UpdateJobRequest) (int64, error)

UpdateJob update job

type ContactInfo

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

ContactInfo monitoring alarm contacts

type CreateHTTPJobRequest

type CreateHTTPJobRequest struct {
	BaseRequest

	HttpJobConfig
}

type CreateHTTPJobResponse

type CreateHTTPJobResponse struct {
	JobId int64 `json:"job_id"`
}

type CreateJavaJobRequest

type CreateJavaJobRequest struct {
	BaseRequest

	JavaJobConfig
}

type CreateJavaJobResponse

type CreateJavaJobResponse struct {
	JobId int64 `json:"job_id"`
}

type DeleteJobRequest

type DeleteJobRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type DisableJobRequest

type DisableJobRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type EnableJobRequest

type EnableJobRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type ExecJobRequest

type ExecJobRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type GetJobInstanceListRequest

type GetJobInstanceListRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type GetJobInstanceRequest

type GetJobInstanceRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type HttpAttribute

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

func NewDefaultHttpAttribute

func NewDefaultHttpAttribute() HttpAttribute

func (*HttpAttribute) IsRequired

func (attr *HttpAttribute) IsRequired() bool

type HttpJobConfig

type HttpJobConfig struct {
	JobBaseConfig
	// contains filtered or unexported fields
}

func NewDefaultHTTPJobConfig

func NewDefaultHTTPJobConfig(className string) HttpJobConfig

func (*HttpJobConfig) IsRequired

func (c *HttpJobConfig) IsRequired() bool

type JSONResult added in v0.0.2

type JSONResult struct {
	Code       int
	ResultCode string // result code
	Success    bool   // if success, for client
	Message    string // error message
	RequestId  string // request unique id
	Data       interface{}
}

type JavaJobConfig

type JavaJobConfig struct {
	JobBaseConfig
	// contains filtered or unexported fields
}

JavaJobConfig java task basic configuration

func NewDefaultJavaJobConfig

func NewDefaultJavaJobConfig(className string) JavaJobConfig

func (JavaJobConfig) IsRequired

func (c JavaJobConfig) IsRequired() bool

type JobBaseConfig

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

JobBaseConfig task public information

func NewDefaultJobBaseConfig

func NewDefaultJobBaseConfig() JobBaseConfig

func (JobBaseConfig) IsRequired

func (c JobBaseConfig) IsRequired() bool

type JobConfigInfo

type JobConfigInfo struct {
	JobBaseConfig
	// contains filtered or unexported fields
}

JobConfigInfo task configuration information

type JobMonitorInfo

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

JobMonitorInfo task alarm information configuration

func NewDefaultJobMonitorInfo

func NewDefaultJobMonitorInfo() JobMonitorInfo

func (JobMonitorInfo) IsRequired

func (c JobMonitorInfo) IsRequired() bool

type KillJobInstanceRequest

type KillJobInstanceRequest struct {
	BaseRequest
	// contains filtered or unexported fields
}

type MapTaskXAttrs

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

func NewDefaultMapTaskXAttrs

func NewDefaultMapTaskXAttrs() MapTaskXAttrs

type MonitorConfig

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

MonitorConfig monitor configuration json content

func NewDefaultMonitorConfig

func NewDefaultMonitorConfig() MonitorConfig

type Option

type Option func(*Client)

func WithApp

func WithApp(app string) Option

func WithAppKey

func WithAppKey(appKey string) Option

func WithGroupId

func WithGroupId(groupId string) Option

func WithHTTPClient

func WithHTTPClient(httpClient http.Client) Option

func WithInitMethod

func WithInitMethod(initMethod string) Option

func WithNamespace

func WithNamespace(namespace string) Option

func WithOpenAPIDomain

func WithOpenAPIDomain(domain string) Option

func WithOpenAPIEndpoint

func WithOpenAPIEndpoint(endpoint string) Option

func WithUser

func WithUser(user string) Option

type TimeConfig

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

TimeConfig time expression

func NewDefaultTimeConfig

func NewDefaultTimeConfig() TimeConfig

func (TimeConfig) IsRequired

func (c TimeConfig) IsRequired() bool

type UpdateJobRequest

type UpdateJobRequest struct {
	BaseRequest

	// Task information to be modified
	JobConfigInfo
}

type UpdateJobResponse

type UpdateJobResponse struct {
	JobId int64 `json:"job_id"`
}

Jump to

Keyboard shortcuts

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