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_session_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 WriterHandlerCurrentWriterIndexByExpiresAtKey

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

func WriterHandlerCurrentWriterIndexByIdKey

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

func WriterHandlerCurrentWriterIndexByProviderKey

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

func WriterHandlerCurrentWriterIndexByUpdatedAtKey

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

func WriterHandlerCurrentWriterIndexByUserIdKey

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

Types

type CurrentWriterView

type CurrentWriterView struct {
	Id        string     `sqlx:"id,primaryKey" json:"id,omitempty"`
	UserId    string     `sqlx:"user_id,required=true" json:"userId,omitempty"`
	Provider  string     `sqlx:"provider,required=true" json:"provider,omitempty"`
	CreatedAt time.Time  `format:"2006-01-02 15:04:05" sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	UpdatedAt *time.Time `format:"2006-01-02 15:04:05" sqlx:"updated_at" json:"updatedAt,omitempty"`
	ExpiresAt time.Time  `format:"2006-01-02 15:04:05" sqlx:"expires_at,required=true" json:"expiresAt,omitempty"`
}

CurrentWriterView is generated canonical view metadata for writer.

type Input

type Input struct {
	Session       []*Session           `` /* 196-byte string literal not displayed */
	WriterKeys    []WriterKeysRow      `` /* 131-byte string literal not displayed */
	CurrentWriter []*CurrentWriterView `` /* 164-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) SetSession

func (input *Input) SetSession(value []*Session)

func (*Input) SetWriterKeys

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

type InputHas

type InputHas struct {
	Session       bool
	WriterKeys    bool
	CurrentWriter bool
}

type Lifecycle

type Lifecycle struct{}

Lifecycle customizes role Input.Session.

func (*Lifecycle) AfterQueue

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

func (*Lifecycle) AfterSequence

func (hooks *Lifecycle) AfterSequence(ctx context.Context, entity *Session, state xhandler.LifecycleContext[Session, 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 (*Lifecycle) Validate

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

type Output

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

Output is the generated output scaffold for writer.

type Session

type Session struct {
	ShouldDelete bool        `sqlx:"-" writer:"delete" json:"shouldDelete,omitempty"`
	Id           string      `sqlx:"id,primaryKey" json:"id,omitempty"`
	UserId       string      `sqlx:"user_id,required=true" json:"userId,omitempty"`
	Provider     string      `sqlx:"provider,required=true" json:"provider,omitempty"`
	CreatedAt    time.Time   `format:"2006-01-02 15:04:05" sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	UpdatedAt    *time.Time  `format:"2006-01-02 15:04:05" sqlx:"updated_at" json:"updatedAt,omitempty"`
	ExpiresAt    time.Time   `format:"2006-01-02 15:04:05" sqlx:"expires_at,required=true" json:"expiresAt,omitempty"`
	Has          *SessionHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"SessionHas"`
}

Session is generated canonical view metadata for writer.

func (*Session) GetCreatedAt

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

func (*Session) GetExpiresAt

func (entity *Session) GetExpiresAt() time.Time

func (*Session) GetId

func (entity *Session) GetId() string

func (*Session) GetProvider

func (entity *Session) GetProvider() string

func (*Session) GetShouldDelete

func (entity *Session) GetShouldDelete() bool

func (*Session) GetUpdatedAt

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

func (*Session) GetUserId

func (entity *Session) GetUserId() string

func (*Session) SetCreatedAt

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

func (*Session) SetExpiresAt

func (entity *Session) SetExpiresAt(value time.Time)

func (*Session) SetId

func (entity *Session) SetId(value string)

func (*Session) SetProvider

func (entity *Session) SetProvider(value string)

func (*Session) SetShouldDelete

func (entity *Session) SetShouldDelete(value bool)

func (*Session) SetUpdatedAt

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

func (*Session) SetUserId

func (entity *Session) SetUserId(value string)

type SessionHas

type SessionHas struct {
	ShouldDelete bool
	Id           bool
	UserId       bool
	Provider     bool
	CreatedAt    bool
	UpdatedAt    bool
	ExpiresAt    bool
}

type WriterComponent

type WriterComponent struct {
	Contract xdatly.Component[Input, Output] "" /* 169-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 WriterHandlerCurrentWriterGroupedByExpiresAt

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

func (WriterHandlerCurrentWriterGroupedByExpiresAt) Has

type WriterHandlerCurrentWriterGroupedById

type WriterHandlerCurrentWriterGroupedById map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedById) Has

type WriterHandlerCurrentWriterGroupedByProvider

type WriterHandlerCurrentWriterGroupedByProvider map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByProvider) Has

type WriterHandlerCurrentWriterGroupedByUpdatedAt

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

func (WriterHandlerCurrentWriterGroupedByUpdatedAt) Has

type WriterHandlerCurrentWriterGroupedByUserId

type WriterHandlerCurrentWriterGroupedByUserId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByUserId) Has

type WriterHandlerCurrentWriterIndexedByCreatedAt

type WriterHandlerCurrentWriterIndexedByCreatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByCreatedAt) Has

type WriterHandlerCurrentWriterIndexedByExpiresAt

type WriterHandlerCurrentWriterIndexedByExpiresAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByExpiresAt) Has

type WriterHandlerCurrentWriterIndexedById

type WriterHandlerCurrentWriterIndexedById map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedById) Has

type WriterHandlerCurrentWriterIndexedByProvider

type WriterHandlerCurrentWriterIndexedByProvider map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByProvider) Has

type WriterHandlerCurrentWriterIndexedByUpdatedAt

type WriterHandlerCurrentWriterIndexedByUpdatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUpdatedAt) Has

type WriterHandlerCurrentWriterIndexedByUserId

type WriterHandlerCurrentWriterIndexedByUserId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUserId) Has

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByCreatedAt

func (WriterHandlerCurrentWriterSlice) GroupByExpiresAt

func (WriterHandlerCurrentWriterSlice) GroupById

func (WriterHandlerCurrentWriterSlice) GroupByProvider

func (WriterHandlerCurrentWriterSlice) GroupByUpdatedAt

func (WriterHandlerCurrentWriterSlice) GroupByUserId

func (WriterHandlerCurrentWriterSlice) IndexByCreatedAt

func (WriterHandlerCurrentWriterSlice) IndexByExpiresAt

func (WriterHandlerCurrentWriterSlice) IndexById

func (WriterHandlerCurrentWriterSlice) IndexByProvider

func (WriterHandlerCurrentWriterSlice) IndexByUpdatedAt

func (WriterHandlerCurrentWriterSlice) IndexByUserId

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