write

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageName = "scheduler/schedule/write"
View Source
var PathURI = "/v1/api/agently/schedule"

Functions

func DefineComponent

func DefineComponent(ctx context.Context, srv *datly.Service) (*repository.Component, error)

Types

type Handler

type Handler struct{}

func (*Handler) Exec

func (h *Handler) Exec(ctx context.Context, sess handler.Session) (interface{}, error)

type Input

type Input struct {
	Schedules []*Schedule `parameter:",kind=body,in=data"`

	CurSchedulesId *struct{ Values []string } `` /* 126-byte string literal not displayed */

	CurSchedule []*Schedule `parameter:",kind=view,in=CurSchedule" view:"CurSchedule" sql:"uri=sql/cur_schedule.sql"`

	CurScheduleById map[string]*Schedule
}

func (*Input) EmbedFS

func (i *Input) EmbedFS() (fs *embed.FS)

func (*Input) Init

func (i *Input) Init(ctx context.Context, sess handler.Session, _ *Output) error

func (*Input) Validate

func (i *Input) Validate(ctx context.Context, sess handler.Session, out *Output) error

type Output

type Output struct {
	response.Status `parameter:",kind=output,in=status" anonymous:"true"`
	Data            []*Schedule            `parameter:",kind=body"`
	Violations      []*validator.Violation `parameter:",kind=transient"`
}

type Schedule

type Schedule struct {
	Id              string       `sqlx:"id,primaryKey" validate:"required"`
	Name            string       `sqlx:"name" validate:"required"`
	Description     *string      `sqlx:"description" json:",omitempty"`
	AgentRef        string       `sqlx:"agent_ref" validate:"required"`
	ModelOverride   *string      `sqlx:"model_override" json:",omitempty"`
	Enabled         bool         `sqlx:"enabled" `
	StartAt         *time.Time   `sqlx:"start_at" json:",omitempty"`
	EndAt           *time.Time   `sqlx:"end_at" json:",omitempty"`
	ScheduleType    string       `sqlx:"schedule_type" validate:"required"`
	CronExpr        *string      `sqlx:"cron_expr" json:",omitempty"`
	IntervalSeconds *int         `sqlx:"interval_seconds" json:",omitempty"`
	Timezone        string       `sqlx:"timezone" validate:"required"`
	TaskPromptUri   *string      `sqlx:"task_prompt_uri" json:",omitempty"`
	TaskPrompt      *string      `sqlx:"task_prompt" json:",omitempty"`
	NextRunAt       *time.Time   `sqlx:"next_run_at" json:",omitempty"`
	LastRunAt       *time.Time   `sqlx:"last_run_at" json:",omitempty"`
	LastStatus      *string      `sqlx:"last_status" json:",omitempty"`
	LastError       *string      `sqlx:"last_error" json:",omitempty"`
	CreatedAt       *time.Time   `sqlx:"created_at" json:",omitempty"`
	UpdatedAt       *time.Time   `sqlx:"updated_at" json:",omitempty"`
	Has             *ScheduleHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func (*Schedule) SetAgentRef

func (m *Schedule) SetAgentRef(v string)

func (*Schedule) SetCreatedAt

func (m *Schedule) SetCreatedAt(v time.Time)

func (*Schedule) SetCronExpr

func (m *Schedule) SetCronExpr(v string)

func (*Schedule) SetDescription

func (m *Schedule) SetDescription(v string)

func (*Schedule) SetEnabled

func (m *Schedule) SetEnabled(v bool)

func (*Schedule) SetEndAt

func (m *Schedule) SetEndAt(v time.Time)

func (*Schedule) SetId

func (m *Schedule) SetId(v string)

func (*Schedule) SetIntervalSeconds

func (m *Schedule) SetIntervalSeconds(v int)

func (*Schedule) SetLastError

func (m *Schedule) SetLastError(v string)

func (*Schedule) SetLastRunAt

func (m *Schedule) SetLastRunAt(v time.Time)

func (*Schedule) SetLastStatus

func (m *Schedule) SetLastStatus(v string)

func (*Schedule) SetModelOverride

func (m *Schedule) SetModelOverride(v string)

func (*Schedule) SetName

func (m *Schedule) SetName(v string)

func (*Schedule) SetNextRunAt

func (m *Schedule) SetNextRunAt(v time.Time)

func (*Schedule) SetScheduleType

func (m *Schedule) SetScheduleType(v string)

func (*Schedule) SetStartAt

func (m *Schedule) SetStartAt(v time.Time)

func (*Schedule) SetTaskPrompt

func (m *Schedule) SetTaskPrompt(v string)

func (*Schedule) SetTaskPromptUri

func (m *Schedule) SetTaskPromptUri(v string)

func (*Schedule) SetTimezone

func (m *Schedule) SetTimezone(v string)

func (*Schedule) SetUpdatedAt

func (m *Schedule) SetUpdatedAt(v time.Time)

type ScheduleHas

type ScheduleHas struct {
	Id              bool
	Name            bool
	Description     bool
	AgentRef        bool
	ModelOverride   bool
	Enabled         bool
	StartAt         bool
	EndAt           bool
	ScheduleType    bool
	CronExpr        bool
	IntervalSeconds bool
	Timezone        bool
	TaskPromptUri   bool
	TaskPrompt      bool
	NextRunAt       bool
	LastRunAt       bool
	LastStatus      bool
	LastError       bool
	CreatedAt       bool
	UpdatedAt       bool
}

type Schedules added in v0.2.2

type Schedules []Schedule

Schedules is a helper slice type referenced by datly `dataType` tags to drive structql markers for the Schedules collection in Input.

Jump to

Keyboard shortcuts

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