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

write

package
v0.1.58 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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const WriterDatlyResourceNamespace = "datly_user_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 WriterHandlerCurrentWriterIndexByCreatedAtKey

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

func WriterHandlerCurrentWriterIndexByDefaultAgentRefKey

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

func WriterHandlerCurrentWriterIndexByDefaultEmbedderRefKey

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

func WriterHandlerCurrentWriterIndexByDefaultModelRefKey

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

func WriterHandlerCurrentWriterIndexByDisabledKey

func WriterHandlerCurrentWriterIndexByDisabledKey(value *CurrentWriterView) (int, bool)

func WriterHandlerCurrentWriterIndexByDisplayNameKey

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

func WriterHandlerCurrentWriterIndexByEmailKey

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

func WriterHandlerCurrentWriterIndexByHashIpKey

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

func WriterHandlerCurrentWriterIndexByIdKey

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

func WriterHandlerCurrentWriterIndexByProviderKey

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

func WriterHandlerCurrentWriterIndexBySettingsKey

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

func WriterHandlerCurrentWriterIndexBySubjectKey

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

func WriterHandlerCurrentWriterIndexByTimezoneKey

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

func WriterHandlerCurrentWriterIndexByUpdatedAtKey

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

func WriterHandlerCurrentWriterIndexByUsernameKey

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

Types

type CurrentWriterView

type CurrentWriterView struct {
	Id                 string     `validate:"required" sqlx:"id,primaryKey" json:"id"`
	Username           string     `validate:"required" json:"username" sqlx:"username,required=true"`
	Provider           string     `validate:"required" json:"provider" sqlx:"provider,required=true"`
	HashIp             *string    `json:"-" sqlx:"hash_ip"`
	Timezone           string     `validate:"required" json:"timezone" sqlx:"timezone,required=true"`
	DisplayName        *string    `sqlx:"display_name" json:"displayName,omitempty"`
	Email              *string    `sqlx:"email" json:"email,omitempty"`
	Subject            *string    `sqlx:"subject" json:"subject,omitempty"`
	DefaultAgentRef    *string    `sqlx:"default_agent_ref" json:"defaultAgentRef,omitempty"`
	DefaultModelRef    *string    `sqlx:"default_model_ref" json:"defaultModelRef,omitempty"`
	DefaultEmbedderRef *string    `sqlx:"default_embedder_ref" json:"defaultEmbedderRef,omitempty"`
	Settings           *string    `sqlx:"settings" json:"settings,omitempty"`
	Disabled           *int       `sqlx:"disabled,required=true" json:"disabled,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 Input

type Input struct {
	Users         []*User              `` /* 159-byte string literal not displayed */
	WriterKeys    []WriterKeysRow      `` /* 126-byte string literal not displayed */
	CurrentWriter []*CurrentWriterView `` /* 159-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) SetUsers

func (input *Input) SetUsers(value []*User)

func (*Input) SetWriterKeys

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

type InputHas

type InputHas struct {
	Users         bool
	WriterKeys    bool
	CurrentWriter bool
}

type Lifecycle

type Lifecycle struct{}

Lifecycle customizes role Input.Users.

func (*Lifecycle) AfterQueue

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

func (*Lifecycle) AfterSequence

func (hooks *Lifecycle) AfterSequence(ctx context.Context, entity *User, state xhandler.LifecycleContext[User, 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 *User, state xhandler.LifecycleContext[User, xhandler.NoParent, Output]) error

func (*Lifecycle) Validate

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

type Output

type Output struct {
	Data []*User `parameter:"Data,kind=output,in=body,dataType=[]*User" json:"data,omitempty"`
}

Output is the generated output scaffold for writer.

type User

type User struct {
	Id                 string     `validate:"required" sqlx:"id,primaryKey" json:"id"`
	Username           string     `validate:"required" json:"username" sqlx:"username,required=true"`
	Provider           string     `validate:"required" json:"provider" sqlx:"provider,required=true"`
	HashIp             *string    `json:"-" sqlx:"hash_ip"`
	Timezone           string     `validate:"required" json:"timezone" sqlx:"timezone,required=true"`
	DisplayName        *string    `sqlx:"display_name" json:"displayName,omitempty"`
	Email              *string    `sqlx:"email" json:"email,omitempty"`
	Subject            *string    `sqlx:"subject" json:"subject,omitempty"`
	DefaultAgentRef    *string    `sqlx:"default_agent_ref" json:"defaultAgentRef,omitempty"`
	DefaultModelRef    *string    `sqlx:"default_model_ref" json:"defaultModelRef,omitempty"`
	DefaultEmbedderRef *string    `sqlx:"default_embedder_ref" json:"defaultEmbedderRef,omitempty"`
	Settings           *string    `sqlx:"settings" json:"settings,omitempty"`
	Disabled           *int       `sqlx:"disabled,required=true" json:"disabled,omitempty"`
	CreatedAt          *time.Time `sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	UpdatedAt          *time.Time `sqlx:"updated_at" json:"updatedAt,omitempty"`
	Has                *UserHas   `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"UserHas"`
}

User is generated canonical view metadata for writer.

func (*User) GetCreatedAt

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

func (*User) GetDefaultAgentRef

func (entity *User) GetDefaultAgentRef() *string

func (*User) GetDefaultEmbedderRef

func (entity *User) GetDefaultEmbedderRef() *string

func (*User) GetDefaultModelRef

func (entity *User) GetDefaultModelRef() *string

func (*User) GetDisabled

func (entity *User) GetDisabled() *int

func (*User) GetDisplayName

func (entity *User) GetDisplayName() *string

func (*User) GetEmail

func (entity *User) GetEmail() *string

func (*User) GetHashIp

func (entity *User) GetHashIp() *string

func (*User) GetId

func (entity *User) GetId() string

func (*User) GetProvider

func (entity *User) GetProvider() string

func (*User) GetSettings

func (entity *User) GetSettings() *string

func (*User) GetSubject

func (entity *User) GetSubject() *string

func (*User) GetTimezone

func (entity *User) GetTimezone() string

func (*User) GetUpdatedAt

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

func (*User) GetUsername

func (entity *User) GetUsername() string

func (*User) SetCreatedAt

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

func (*User) SetDefaultAgentRef

func (entity *User) SetDefaultAgentRef(value *string)

func (*User) SetDefaultEmbedderRef

func (entity *User) SetDefaultEmbedderRef(value *string)

func (*User) SetDefaultModelRef

func (entity *User) SetDefaultModelRef(value *string)

func (*User) SetDisabled

func (entity *User) SetDisabled(value *int)

func (*User) SetDisplayName

func (entity *User) SetDisplayName(value *string)

func (*User) SetEmail

func (entity *User) SetEmail(value *string)

func (*User) SetHashIp

func (entity *User) SetHashIp(value *string)

func (*User) SetId

func (entity *User) SetId(value string)

func (*User) SetProvider

func (entity *User) SetProvider(value string)

func (*User) SetSettings

func (entity *User) SetSettings(value *string)

func (*User) SetSubject

func (entity *User) SetSubject(value *string)

func (*User) SetTimezone

func (entity *User) SetTimezone(value string)

func (*User) SetUpdatedAt

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

func (*User) SetUsername

func (entity *User) SetUsername(value string)

type UserHas

type UserHas struct {
	Id                 bool
	Username           bool
	Provider           bool
	HashIp             bool
	Timezone           bool
	DisplayName        bool
	Email              bool
	Subject            bool
	DefaultAgentRef    bool
	DefaultModelRef    bool
	DefaultEmbedderRef bool
	Settings           bool
	Disabled           bool
	CreatedAt          bool
	UpdatedAt          bool
}

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 WriterHandlerCurrentWriterGroupedByCreatedAt

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

func (WriterHandlerCurrentWriterGroupedByCreatedAt) Has

type WriterHandlerCurrentWriterGroupedByDefaultAgentRef

type WriterHandlerCurrentWriterGroupedByDefaultAgentRef map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByDefaultAgentRef) Has

type WriterHandlerCurrentWriterGroupedByDefaultEmbedderRef

type WriterHandlerCurrentWriterGroupedByDefaultEmbedderRef map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByDefaultEmbedderRef) Has

type WriterHandlerCurrentWriterGroupedByDefaultModelRef

type WriterHandlerCurrentWriterGroupedByDefaultModelRef map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByDefaultModelRef) Has

type WriterHandlerCurrentWriterGroupedByDisabled

type WriterHandlerCurrentWriterGroupedByDisabled map[int][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByDisabled) Has

type WriterHandlerCurrentWriterGroupedByDisplayName

type WriterHandlerCurrentWriterGroupedByDisplayName map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByDisplayName) Has

type WriterHandlerCurrentWriterGroupedByEmail

type WriterHandlerCurrentWriterGroupedByEmail map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByEmail) Has

type WriterHandlerCurrentWriterGroupedByHashIp

type WriterHandlerCurrentWriterGroupedByHashIp map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByHashIp) Has

type WriterHandlerCurrentWriterGroupedById

type WriterHandlerCurrentWriterGroupedById map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedById) Has

type WriterHandlerCurrentWriterGroupedByProvider

type WriterHandlerCurrentWriterGroupedByProvider map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByProvider) Has

type WriterHandlerCurrentWriterGroupedBySettings

type WriterHandlerCurrentWriterGroupedBySettings map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedBySettings) Has

type WriterHandlerCurrentWriterGroupedBySubject

type WriterHandlerCurrentWriterGroupedBySubject map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedBySubject) Has

type WriterHandlerCurrentWriterGroupedByTimezone

type WriterHandlerCurrentWriterGroupedByTimezone map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByTimezone) Has

type WriterHandlerCurrentWriterGroupedByUpdatedAt

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

func (WriterHandlerCurrentWriterGroupedByUpdatedAt) Has

type WriterHandlerCurrentWriterGroupedByUsername

type WriterHandlerCurrentWriterGroupedByUsername map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByUsername) Has

type WriterHandlerCurrentWriterIndexedByCreatedAt

type WriterHandlerCurrentWriterIndexedByCreatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByCreatedAt) Has

type WriterHandlerCurrentWriterIndexedByDefaultAgentRef

type WriterHandlerCurrentWriterIndexedByDefaultAgentRef map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByDefaultAgentRef) Has

type WriterHandlerCurrentWriterIndexedByDefaultEmbedderRef

type WriterHandlerCurrentWriterIndexedByDefaultEmbedderRef map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByDefaultEmbedderRef) Has

type WriterHandlerCurrentWriterIndexedByDefaultModelRef

type WriterHandlerCurrentWriterIndexedByDefaultModelRef map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByDefaultModelRef) Has

type WriterHandlerCurrentWriterIndexedByDisabled

type WriterHandlerCurrentWriterIndexedByDisabled map[int]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByDisabled) Has

type WriterHandlerCurrentWriterIndexedByDisplayName

type WriterHandlerCurrentWriterIndexedByDisplayName map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByDisplayName) Has

type WriterHandlerCurrentWriterIndexedByEmail

type WriterHandlerCurrentWriterIndexedByEmail map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByEmail) Has

type WriterHandlerCurrentWriterIndexedByHashIp

type WriterHandlerCurrentWriterIndexedByHashIp map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByHashIp) Has

type WriterHandlerCurrentWriterIndexedById

type WriterHandlerCurrentWriterIndexedById map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedById) Has

type WriterHandlerCurrentWriterIndexedByProvider

type WriterHandlerCurrentWriterIndexedByProvider map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByProvider) Has

type WriterHandlerCurrentWriterIndexedBySettings

type WriterHandlerCurrentWriterIndexedBySettings map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedBySettings) Has

type WriterHandlerCurrentWriterIndexedBySubject

type WriterHandlerCurrentWriterIndexedBySubject map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedBySubject) Has

type WriterHandlerCurrentWriterIndexedByTimezone

type WriterHandlerCurrentWriterIndexedByTimezone map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByTimezone) Has

type WriterHandlerCurrentWriterIndexedByUpdatedAt

type WriterHandlerCurrentWriterIndexedByUpdatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUpdatedAt) Has

type WriterHandlerCurrentWriterIndexedByUsername

type WriterHandlerCurrentWriterIndexedByUsername map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUsername) Has

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByCreatedAt

func (WriterHandlerCurrentWriterSlice) GroupByDefaultAgentRef

func (WriterHandlerCurrentWriterSlice) GroupByDefaultEmbedderRef

func (WriterHandlerCurrentWriterSlice) GroupByDefaultModelRef

func (WriterHandlerCurrentWriterSlice) GroupByDisabled

func (WriterHandlerCurrentWriterSlice) GroupByDisplayName

func (WriterHandlerCurrentWriterSlice) GroupByEmail

func (WriterHandlerCurrentWriterSlice) GroupByHashIp

func (WriterHandlerCurrentWriterSlice) GroupById

func (WriterHandlerCurrentWriterSlice) GroupByProvider

func (WriterHandlerCurrentWriterSlice) GroupBySettings

func (WriterHandlerCurrentWriterSlice) GroupBySubject

func (WriterHandlerCurrentWriterSlice) GroupByTimezone

func (WriterHandlerCurrentWriterSlice) GroupByUpdatedAt

func (WriterHandlerCurrentWriterSlice) GroupByUsername

func (WriterHandlerCurrentWriterSlice) IndexByCreatedAt

func (WriterHandlerCurrentWriterSlice) IndexByDefaultAgentRef

func (WriterHandlerCurrentWriterSlice) IndexByDefaultEmbedderRef

func (WriterHandlerCurrentWriterSlice) IndexByDefaultModelRef

func (WriterHandlerCurrentWriterSlice) IndexByDisabled

func (WriterHandlerCurrentWriterSlice) IndexByDisplayName

func (WriterHandlerCurrentWriterSlice) IndexByEmail

func (WriterHandlerCurrentWriterSlice) IndexByHashIp

func (WriterHandlerCurrentWriterSlice) IndexById

func (WriterHandlerCurrentWriterSlice) IndexByProvider

func (WriterHandlerCurrentWriterSlice) IndexBySettings

func (WriterHandlerCurrentWriterSlice) IndexBySubject

func (WriterHandlerCurrentWriterSlice) IndexByTimezone

func (WriterHandlerCurrentWriterSlice) IndexByUpdatedAt

func (WriterHandlerCurrentWriterSlice) IndexByUsername

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