Help us shape the future of Go! Take the 2026 Go Developer Survey

write

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const WriterDatlyResourceNamespace = "datly_goal_write_writer"

DatlyResourceNamespace identifies this package's generated resource filesystem.

Variables

View Source
var (
	LifecycleHooks = new(Lifecycle)
	LifecycleDatly = LifecycleDatlyType()
)
View Source
var WriterDatly = new(WriterComponent)

The public value supports explicit component wiring.

View Source
var WriterDatlyResources embed.FS

Functions

func LifecycleDatlyType

func LifecycleDatlyType() reflect.Type

func WriterDatlyType

func WriterDatlyType() reflect.Type

WriterDatlyType returns the public component type.

func WriterHandlerCurrentWriterIndexByAutonomousTurnsUsedKey

func WriterHandlerCurrentWriterIndexByAutonomousTurnsUsedKey(value *CurrentWriterView) (int64, bool)

func WriterHandlerCurrentWriterIndexByConsecutiveNoProgressKey

func WriterHandlerCurrentWriterIndexByConsecutiveNoProgressKey(value *CurrentWriterView) (int64, bool)

func WriterHandlerCurrentWriterIndexByControllerSpecKey

func WriterHandlerCurrentWriterIndexByControllerSpecKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByConversationIdKey

func WriterHandlerCurrentWriterIndexByConversationIdKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByCreatedAtKey

func WriterHandlerCurrentWriterIndexByCreatedAtKey(value *CurrentWriterView) (time.Time, bool)

func WriterHandlerCurrentWriterIndexByIdKey

func WriterHandlerCurrentWriterIndexByIdKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByLastContinuationFingerprintKey

func WriterHandlerCurrentWriterIndexByLastContinuationFingerprintKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByObjectiveKey

func WriterHandlerCurrentWriterIndexByObjectiveKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByPauseReasonKey

func WriterHandlerCurrentWriterIndexByPauseReasonKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByStatusKey

func WriterHandlerCurrentWriterIndexByStatusKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByStatusReasonKey

func WriterHandlerCurrentWriterIndexByStatusReasonKey(value *CurrentWriterView) (string, bool)

func WriterHandlerCurrentWriterIndexByTimeUsedSecondsKey

func WriterHandlerCurrentWriterIndexByTimeUsedSecondsKey(value *CurrentWriterView) (int64, bool)

func WriterHandlerCurrentWriterIndexByTokenBudgetKey

func WriterHandlerCurrentWriterIndexByTokenBudgetKey(value *CurrentWriterView) (int64, bool)

func WriterHandlerCurrentWriterIndexByTokensUsedKey

func WriterHandlerCurrentWriterIndexByTokensUsedKey(value *CurrentWriterView) (int64, bool)

func WriterHandlerCurrentWriterIndexByUpdatedAtKey

func WriterHandlerCurrentWriterIndexByUpdatedAtKey(value *CurrentWriterView) (time.Time, bool)

Types

type CurrentWriterView

type CurrentWriterView struct {
	Id                          string     `validate:"required" sqlx:"id,primaryKey" json:"id"`
	TokenBudget                 *int64     `sqlx:"token_budget" json:"tokenBudget,omitempty"`
	TokensUsed                  *int64     `sqlx:"tokens_used,required=true" json:"tokensUsed,omitempty"`
	TimeUsedSeconds             *int64     `sqlx:"time_used_seconds,required=true" json:"timeUsedSeconds,omitempty"`
	AutonomousTurnsUsed         *int64     `sqlx:"autonomous_turns_used,required=true" json:"autonomousTurnsUsed,omitempty"`
	ConsecutiveNoProgress       *int64     `sqlx:"consecutive_no_progress,required=true" json:"consecutiveNoProgress,omitempty"`
	ConversationId              *string    `sqlx:"conversation_id,refTable=conversation,refColumn=id,required=true" json:"conversationId,omitempty"`
	Objective                   *string    `sqlx:"objective,required=true" json:"objective,omitempty"`
	Status                      *string    `sqlx:"status,required=true" json:"status,omitempty"`
	StatusReason                *string    `sqlx:"status_reason" json:"statusReason,omitempty"`
	PauseReason                 *string    `sqlx:"pause_reason" json:"pauseReason,omitempty"`
	ControllerSpec              *string    `sqlx:"controller_spec" json:"controllerSpec,omitempty"`
	LastContinuationFingerprint *string    `sqlx:"last_continuation_fingerprint" json:"lastContinuationFingerprint,omitempty"`
	CreatedAt                   *time.Time `sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	UpdatedAt                   *time.Time `sqlx:"updated_at" json:"updatedAt,omitempty"`
}

CurrentWriterView is generated canonical view metadata for writer.

type Goal

type Goal struct {
	ShouldDelete                bool       `sqlx:"-" writer:"delete" json:"shouldDelete,omitempty"`
	Id                          string     `validate:"required" sqlx:"id,primaryKey" json:"id"`
	TokenBudget                 *int64     `sqlx:"token_budget" json:"tokenBudget,omitempty"`
	TokensUsed                  *int64     `sqlx:"tokens_used,required=true" json:"tokensUsed,omitempty"`
	TimeUsedSeconds             *int64     `sqlx:"time_used_seconds,required=true" json:"timeUsedSeconds,omitempty"`
	AutonomousTurnsUsed         *int64     `sqlx:"autonomous_turns_used,required=true" json:"autonomousTurnsUsed,omitempty"`
	ConsecutiveNoProgress       *int64     `sqlx:"consecutive_no_progress,required=true" json:"consecutiveNoProgress,omitempty"`
	ConversationId              *string    `sqlx:"conversation_id,refTable=conversation,refColumn=id,required=true" json:"conversationId,omitempty"`
	Objective                   *string    `sqlx:"objective,required=true" json:"objective,omitempty"`
	Status                      *string    `sqlx:"status,required=true" json:"status,omitempty"`
	StatusReason                *string    `sqlx:"status_reason" json:"statusReason,omitempty"`
	PauseReason                 *string    `sqlx:"pause_reason" json:"pauseReason,omitempty"`
	ControllerSpec              *string    `sqlx:"controller_spec" json:"controllerSpec,omitempty"`
	LastContinuationFingerprint *string    `sqlx:"last_continuation_fingerprint" json:"lastContinuationFingerprint,omitempty"`
	CreatedAt                   *time.Time `sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	UpdatedAt                   *time.Time `sqlx:"updated_at" json:"updatedAt,omitempty"`
	Has                         *GoalHas   `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"GoalHas"`
}

Goal is generated canonical view metadata for writer.

func (*Goal) GetAutonomousTurnsUsed

func (entity *Goal) GetAutonomousTurnsUsed() *int64

func (*Goal) GetConsecutiveNoProgress

func (entity *Goal) GetConsecutiveNoProgress() *int64

func (*Goal) GetControllerSpec

func (entity *Goal) GetControllerSpec() *string

func (*Goal) GetConversationId

func (entity *Goal) GetConversationId() *string

func (*Goal) GetCreatedAt

func (entity *Goal) GetCreatedAt() *time.Time

func (*Goal) GetId

func (entity *Goal) GetId() string

func (*Goal) GetLastContinuationFingerprint

func (entity *Goal) GetLastContinuationFingerprint() *string

func (*Goal) GetObjective

func (entity *Goal) GetObjective() *string

func (*Goal) GetPauseReason

func (entity *Goal) GetPauseReason() *string

func (*Goal) GetShouldDelete

func (entity *Goal) GetShouldDelete() bool

func (*Goal) GetStatus

func (entity *Goal) GetStatus() *string

func (*Goal) GetStatusReason

func (entity *Goal) GetStatusReason() *string

func (*Goal) GetTimeUsedSeconds

func (entity *Goal) GetTimeUsedSeconds() *int64

func (*Goal) GetTokenBudget

func (entity *Goal) GetTokenBudget() *int64

func (*Goal) GetTokensUsed

func (entity *Goal) GetTokensUsed() *int64

func (*Goal) GetUpdatedAt

func (entity *Goal) GetUpdatedAt() *time.Time

func (*Goal) SetAutonomousTurnsUsed

func (entity *Goal) SetAutonomousTurnsUsed(value *int64)

func (*Goal) SetConsecutiveNoProgress

func (entity *Goal) SetConsecutiveNoProgress(value *int64)

func (*Goal) SetControllerSpec

func (entity *Goal) SetControllerSpec(value *string)

func (*Goal) SetConversationId

func (entity *Goal) SetConversationId(value *string)

func (*Goal) SetCreatedAt

func (entity *Goal) SetCreatedAt(value *time.Time)

func (*Goal) SetId

func (entity *Goal) SetId(value string)

func (*Goal) SetLastContinuationFingerprint

func (entity *Goal) SetLastContinuationFingerprint(value *string)

func (*Goal) SetObjective

func (entity *Goal) SetObjective(value *string)

func (*Goal) SetPauseReason

func (entity *Goal) SetPauseReason(value *string)

func (*Goal) SetShouldDelete

func (entity *Goal) SetShouldDelete(value bool)

func (*Goal) SetStatus

func (entity *Goal) SetStatus(value *string)

func (*Goal) SetStatusReason

func (entity *Goal) SetStatusReason(value *string)

func (*Goal) SetTimeUsedSeconds

func (entity *Goal) SetTimeUsedSeconds(value *int64)

func (*Goal) SetTokenBudget

func (entity *Goal) SetTokenBudget(value *int64)

func (*Goal) SetTokensUsed

func (entity *Goal) SetTokensUsed(value *int64)

func (*Goal) SetUpdatedAt

func (entity *Goal) SetUpdatedAt(value *time.Time)

type GoalHas

type GoalHas struct {
	ShouldDelete                bool
	Id                          bool
	TokenBudget                 bool
	TokensUsed                  bool
	TimeUsedSeconds             bool
	AutonomousTurnsUsed         bool
	ConsecutiveNoProgress       bool
	ConversationId              bool
	Objective                   bool
	Status                      bool
	StatusReason                bool
	PauseReason                 bool
	ControllerSpec              bool
	LastContinuationFingerprint bool
	CreatedAt                   bool
	UpdatedAt                   bool
}

type Input

type Input struct {
	Goals         []*Goal              `` /* 182-byte string literal not displayed */
	WriterKeys    []WriterKeysRow      `` /* 126-byte string literal not displayed */
	CurrentWriter []*CurrentWriterView `` /* 158-byte string literal not displayed */

	Has *InputHas `setMarker:"true" typeName:"InputHas" json:"-" sqlx:"-"`
	// contains filtered or unexported fields
}

Input is the generated input scaffold for writer.

func (*Input) PrepareReadIndexes

func (input *Input) PrepareReadIndexes(ctx context.Context) error

func (*Input) ReadIndexes

func (input *Input) ReadIndexes(ctx context.Context) (*WriterHandlerReadIndexes, error)

func (*Input) SetCurrentWriter

func (input *Input) SetCurrentWriter(value []*CurrentWriterView)

func (*Input) SetGoals

func (input *Input) SetGoals(value []*Goal)

func (*Input) SetWriterKeys

func (input *Input) SetWriterKeys(value []WriterKeysRow)

type InputHas

type InputHas struct {
	Goals         bool
	WriterKeys    bool
	CurrentWriter bool
}

type Lifecycle

type Lifecycle struct{}

Lifecycle customizes role Input.Goals.

func (*Lifecycle) AfterQueue

func (hooks *Lifecycle) AfterQueue(ctx context.Context, entity *Goal, state xhandler.LifecycleContext[Goal, xhandler.NoParent, Output]) error

func (*Lifecycle) AfterSequence

func (hooks *Lifecycle) AfterSequence(ctx context.Context, entity *Goal, state xhandler.LifecycleContext[Goal, xhandler.NoParent, Output]) error

func (*Lifecycle) Finalize

func (hooks *Lifecycle) Finalize(ctx context.Context, input *Input, output *Output, outcome xhandler.Outcome) error

func (*Lifecycle) Init

func (hooks *Lifecycle) Init(ctx context.Context, entity *Goal, state xhandler.LifecycleContext[Goal, xhandler.NoParent, Output]) error

func (*Lifecycle) Validate

func (hooks *Lifecycle) Validate(ctx context.Context, entity *Goal, state xhandler.LifecycleContext[Goal, xhandler.NoParent, Output]) error

type Output

type Output struct {
	response.Status `parameter:",kind=output,in=status"`
	Data            []*Goal `parameter:"Data,kind=output,in=body,dataType=[]*Goal" json:"data,omitempty"`
}

Output is the generated output scaffold for writer.

type WriterComponent

type WriterComponent struct {
	Contract xdatly.Component[Input, Output] "" /* 161-byte string literal not displayed */
}

Component is the generated component scaffold for writer.

func (WriterComponent) EmbedFS

func (WriterComponent) EmbedFS() *embed.FS

func (WriterComponent) EmbedNamespace

func (WriterComponent) EmbedNamespace() string

type WriterHandlerCurrentWriterGroupedByAutonomousTurnsUsed

type WriterHandlerCurrentWriterGroupedByAutonomousTurnsUsed map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByAutonomousTurnsUsed) Has

type WriterHandlerCurrentWriterGroupedByConsecutiveNoProgress

type WriterHandlerCurrentWriterGroupedByConsecutiveNoProgress map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByConsecutiveNoProgress) Has

type WriterHandlerCurrentWriterGroupedByControllerSpec

type WriterHandlerCurrentWriterGroupedByControllerSpec map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByControllerSpec) Has

type WriterHandlerCurrentWriterGroupedByConversationId

type WriterHandlerCurrentWriterGroupedByConversationId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByConversationId) Has

type WriterHandlerCurrentWriterGroupedByCreatedAt

type WriterHandlerCurrentWriterGroupedByCreatedAt map[time.Time][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByCreatedAt) Has

type WriterHandlerCurrentWriterGroupedById

type WriterHandlerCurrentWriterGroupedById map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedById) Has

type WriterHandlerCurrentWriterGroupedByLastContinuationFingerprint

type WriterHandlerCurrentWriterGroupedByLastContinuationFingerprint map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByLastContinuationFingerprint) Has

type WriterHandlerCurrentWriterGroupedByObjective

type WriterHandlerCurrentWriterGroupedByObjective map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByObjective) Has

type WriterHandlerCurrentWriterGroupedByPauseReason

type WriterHandlerCurrentWriterGroupedByPauseReason map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByPauseReason) Has

type WriterHandlerCurrentWriterGroupedByStatus

type WriterHandlerCurrentWriterGroupedByStatus map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByStatus) Has

type WriterHandlerCurrentWriterGroupedByStatusReason

type WriterHandlerCurrentWriterGroupedByStatusReason map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByStatusReason) Has

type WriterHandlerCurrentWriterGroupedByTimeUsedSeconds

type WriterHandlerCurrentWriterGroupedByTimeUsedSeconds map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByTimeUsedSeconds) Has

type WriterHandlerCurrentWriterGroupedByTokenBudget

type WriterHandlerCurrentWriterGroupedByTokenBudget map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByTokenBudget) Has

type WriterHandlerCurrentWriterGroupedByTokensUsed

type WriterHandlerCurrentWriterGroupedByTokensUsed map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByTokensUsed) Has

type WriterHandlerCurrentWriterGroupedByUpdatedAt

type WriterHandlerCurrentWriterGroupedByUpdatedAt map[time.Time][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByUpdatedAt) Has

type WriterHandlerCurrentWriterIndexedByAutonomousTurnsUsed

type WriterHandlerCurrentWriterIndexedByAutonomousTurnsUsed map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByAutonomousTurnsUsed) Has

type WriterHandlerCurrentWriterIndexedByConsecutiveNoProgress

type WriterHandlerCurrentWriterIndexedByConsecutiveNoProgress map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByConsecutiveNoProgress) Has

type WriterHandlerCurrentWriterIndexedByControllerSpec

type WriterHandlerCurrentWriterIndexedByControllerSpec map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByControllerSpec) Has

type WriterHandlerCurrentWriterIndexedByConversationId

type WriterHandlerCurrentWriterIndexedByConversationId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByConversationId) Has

type WriterHandlerCurrentWriterIndexedByCreatedAt

type WriterHandlerCurrentWriterIndexedByCreatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByCreatedAt) Has

type WriterHandlerCurrentWriterIndexedById

type WriterHandlerCurrentWriterIndexedById map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedById) Has

type WriterHandlerCurrentWriterIndexedByLastContinuationFingerprint

type WriterHandlerCurrentWriterIndexedByLastContinuationFingerprint map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByLastContinuationFingerprint) Has

type WriterHandlerCurrentWriterIndexedByObjective

type WriterHandlerCurrentWriterIndexedByObjective map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByObjective) Has

type WriterHandlerCurrentWriterIndexedByPauseReason

type WriterHandlerCurrentWriterIndexedByPauseReason map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByPauseReason) Has

type WriterHandlerCurrentWriterIndexedByStatus

type WriterHandlerCurrentWriterIndexedByStatus map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByStatus) Has

type WriterHandlerCurrentWriterIndexedByStatusReason

type WriterHandlerCurrentWriterIndexedByStatusReason map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByStatusReason) Has

type WriterHandlerCurrentWriterIndexedByTimeUsedSeconds

type WriterHandlerCurrentWriterIndexedByTimeUsedSeconds map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByTimeUsedSeconds) Has

type WriterHandlerCurrentWriterIndexedByTokenBudget

type WriterHandlerCurrentWriterIndexedByTokenBudget map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByTokenBudget) Has

type WriterHandlerCurrentWriterIndexedByTokensUsed

type WriterHandlerCurrentWriterIndexedByTokensUsed map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByTokensUsed) Has

type WriterHandlerCurrentWriterIndexedByUpdatedAt

type WriterHandlerCurrentWriterIndexedByUpdatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUpdatedAt) Has

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByAutonomousTurnsUsed

func (WriterHandlerCurrentWriterSlice) GroupByConsecutiveNoProgress

func (WriterHandlerCurrentWriterSlice) GroupByControllerSpec

func (WriterHandlerCurrentWriterSlice) GroupByConversationId

func (WriterHandlerCurrentWriterSlice) GroupByCreatedAt

func (WriterHandlerCurrentWriterSlice) GroupById

func (WriterHandlerCurrentWriterSlice) GroupByLastContinuationFingerprint

func (WriterHandlerCurrentWriterSlice) GroupByObjective

func (WriterHandlerCurrentWriterSlice) GroupByPauseReason

func (WriterHandlerCurrentWriterSlice) GroupByStatus

func (WriterHandlerCurrentWriterSlice) GroupByStatusReason

func (WriterHandlerCurrentWriterSlice) GroupByTimeUsedSeconds

func (WriterHandlerCurrentWriterSlice) GroupByTokenBudget

func (WriterHandlerCurrentWriterSlice) GroupByTokensUsed

func (WriterHandlerCurrentWriterSlice) GroupByUpdatedAt

func (WriterHandlerCurrentWriterSlice) IndexByAutonomousTurnsUsed

func (WriterHandlerCurrentWriterSlice) IndexByConsecutiveNoProgress

func (WriterHandlerCurrentWriterSlice) IndexByControllerSpec

func (WriterHandlerCurrentWriterSlice) IndexByConversationId

func (WriterHandlerCurrentWriterSlice) IndexByCreatedAt

func (WriterHandlerCurrentWriterSlice) IndexById

func (WriterHandlerCurrentWriterSlice) IndexByLastContinuationFingerprint

func (WriterHandlerCurrentWriterSlice) IndexByObjective

func (WriterHandlerCurrentWriterSlice) IndexByPauseReason

func (WriterHandlerCurrentWriterSlice) IndexByStatus

func (WriterHandlerCurrentWriterSlice) IndexByStatusReason

func (WriterHandlerCurrentWriterSlice) IndexByTimeUsedSeconds

func (WriterHandlerCurrentWriterSlice) IndexByTokenBudget

func (WriterHandlerCurrentWriterSlice) IndexByTokensUsed

func (WriterHandlerCurrentWriterSlice) IndexByUpdatedAt

type WriterHandlerReadIndexes

type WriterHandlerReadIndexes struct {
	CurrentWriter     WriterHandlerCurrentWriterSlice
	CurrentWriterById WriterHandlerCurrentWriterIndexedById
}

func BuildWriterHandlerReadIndexes

func BuildWriterHandlerReadIndexes(ctx context.Context, input *Input) (*WriterHandlerReadIndexes, error)

type WriterKeysRow

type WriterKeysRow struct {
	Id string `sqlx:"id"`
}

Jump to

Keyboard shortcuts

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