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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const WriterDatlyResourceNamespace = "reporting_context_write_writer"

DatlyResourceNamespace identifies this package's generated resource filesystem.

Variables

View Source
var (
	ErrOwnerDenied = errors.New("report context owner denied")
	ErrNotFound    = errors.New("report context not found")
	ErrCASMismatch = errors.New("report context revision mismatch")
)
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 WriterHandlerCurrentWriterIndexByActivationSourceKey

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

func WriterHandlerCurrentWriterIndexByActiveReportRunIdKey

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

func WriterHandlerCurrentWriterIndexByActorIdKey

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

func WriterHandlerCurrentWriterIndexByConversationIdKey

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

func WriterHandlerCurrentWriterIndexByOwnerIdKey

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

func WriterHandlerCurrentWriterIndexByRevisionKey

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

func WriterHandlerCurrentWriterIndexByUpdatedAtKey

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

Types

type Context

type Context struct {
	ShouldDelete      bool        `json:"shouldDelete,omitempty" sqlx:"-" writer:"delete"`
	Revision          int64       `writer:"concurrency" sqlx:"revision,required=true" json:"revision,omitempty"`
	OwnerId           string      `sqlx:"owner_id,primaryKey=true,required=true,refTable=report_run,refColumn=owner_id" json:"ownerId,omitempty"`
	ConversationId    string      `sqlx:"conversation_id,primaryKey=true,required=true,refTable=conversation,refColumn=id" json:"conversationId,omitempty"`
	ActiveReportRunId string      `sqlx:"active_report_run_id,refTable=report_run,refColumn=report_run_id,required=true" json:"activeReportRunId,omitempty"`
	ActivationSource  string      `sqlx:"activation_source,required=true" json:"activationSource,omitempty"`
	ActorId           string      `sqlx:"actor_id,required=true" json:"actorId,omitempty"`
	UpdatedAt         time.Time   `sqlx:"updated_at,required=true" json:"updatedAt,omitempty"`
	Has               *ContextHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"ContextHas"`
}

Context is generated canonical view metadata for writer.

func (*Context) GetActivationSource

func (entity *Context) GetActivationSource() string

func (*Context) GetActiveReportRunId

func (entity *Context) GetActiveReportRunId() string

func (*Context) GetActorId

func (entity *Context) GetActorId() string

func (*Context) GetConversationId

func (entity *Context) GetConversationId() string

func (*Context) GetOwnerId

func (entity *Context) GetOwnerId() string

func (*Context) GetRevision

func (entity *Context) GetRevision() int64

func (*Context) GetShouldDelete

func (entity *Context) GetShouldDelete() bool

func (*Context) GetUpdatedAt

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

func (*Context) SetActivationSource

func (entity *Context) SetActivationSource(value string)

func (*Context) SetActiveReportRunId

func (entity *Context) SetActiveReportRunId(value string)

func (*Context) SetActorId

func (entity *Context) SetActorId(value string)

func (*Context) SetConversationId

func (entity *Context) SetConversationId(value string)

func (*Context) SetOwnerId

func (entity *Context) SetOwnerId(value string)

func (*Context) SetRevision

func (entity *Context) SetRevision(value int64)

func (*Context) SetShouldDelete

func (entity *Context) SetShouldDelete(value bool)

func (*Context) SetUpdatedAt

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

type ContextHas

type ContextHas struct {
	ShouldDelete      bool
	Revision          bool
	OwnerId           bool
	ConversationId    bool
	ActiveReportRunId bool
	ActivationSource  bool
	ActorId           bool
	UpdatedAt         bool
}

type CurrentWriterView

type CurrentWriterView struct {
	Revision          int64     `sqlx:"revision,required=true" json:"revision,omitempty"`
	OwnerId           string    `sqlx:"owner_id,primaryKey=true,required=true,refTable=report_run,refColumn=owner_id" json:"ownerId,omitempty"`
	ConversationId    string    `sqlx:"conversation_id,primaryKey=true,required=true,refTable=conversation,refColumn=id" json:"conversationId,omitempty"`
	ActiveReportRunId string    `sqlx:"active_report_run_id,refTable=report_run,refColumn=report_run_id,required=true" json:"activeReportRunId,omitempty"`
	ActivationSource  string    `sqlx:"activation_source,required=true" json:"activationSource,omitempty"`
	ActorId           string    `sqlx:"actor_id,required=true" json:"actorId,omitempty"`
	UpdatedAt         time.Time `sqlx:"updated_at,required=true" json:"updatedAt,omitempty"`
}

CurrentWriterView is generated canonical view metadata for writer.

type Input

type Input struct {
	Internal        bool                 `parameter:"Internal,kind=reportaccess,in=internal,dataType=bool,required=true"`
	OwnerSubject    *string              `parameter:"OwnerSubject,kind=visibility,in=subject,dataType=*string,required=true"`
	DesiredRevision int64                `parameter:"DesiredRevision,kind=query,in=desiredRevision,dataType=int64,required=false"`
	Contexts        []*Context           `` /* 220-byte string literal not displayed */
	WriterKeys      []WriterKeysRow      `` /* 136-byte string literal not displayed */
	CurrentWriter   []*CurrentWriterView `` /* 188-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) SetContexts

func (input *Input) SetContexts(value []*Context)

func (*Input) SetCurrentWriter

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

func (*Input) SetDesiredRevision

func (input *Input) SetDesiredRevision(value int64)

func (*Input) SetInternal

func (input *Input) SetInternal(value bool)

func (*Input) SetOwnerSubject

func (input *Input) SetOwnerSubject(value *string)

func (*Input) SetWriterKeys

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

type InputHas

type InputHas struct {
	Internal        bool
	OwnerSubject    bool
	DesiredRevision bool
	Contexts        bool
	WriterKeys      bool
	CurrentWriter   bool
}

type Lifecycle

type Lifecycle struct {
	Input *Input `bind:"kind=input"`
}

Lifecycle customizes role Input.Contexts.

func (*Lifecycle) AfterQueue

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

func (*Lifecycle) AfterSequence

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

type Output

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

Output is the generated output scaffold for writer.

type WriterComponent

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

type WriterHandlerCurrentWriterGroupedByActivationSource map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByActivationSource) Has

type WriterHandlerCurrentWriterGroupedByActiveReportRunId

type WriterHandlerCurrentWriterGroupedByActiveReportRunId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByActiveReportRunId) Has

type WriterHandlerCurrentWriterGroupedByActorId

type WriterHandlerCurrentWriterGroupedByActorId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByActorId) Has

type WriterHandlerCurrentWriterGroupedByConversationId

type WriterHandlerCurrentWriterGroupedByConversationId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByConversationId) Has

type WriterHandlerCurrentWriterGroupedByKey

type WriterHandlerCurrentWriterGroupedByKey map[WriterHandlerCurrentWriterKey][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByKey) Has

type WriterHandlerCurrentWriterGroupedByOwnerId

type WriterHandlerCurrentWriterGroupedByOwnerId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByOwnerId) Has

type WriterHandlerCurrentWriterGroupedByRevision

type WriterHandlerCurrentWriterGroupedByRevision map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByRevision) Has

type WriterHandlerCurrentWriterGroupedByUpdatedAt

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

func (WriterHandlerCurrentWriterGroupedByUpdatedAt) Has

type WriterHandlerCurrentWriterIndexedByActivationSource

type WriterHandlerCurrentWriterIndexedByActivationSource map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByActivationSource) Has

type WriterHandlerCurrentWriterIndexedByActiveReportRunId

type WriterHandlerCurrentWriterIndexedByActiveReportRunId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByActiveReportRunId) Has

type WriterHandlerCurrentWriterIndexedByActorId

type WriterHandlerCurrentWriterIndexedByActorId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByActorId) Has

type WriterHandlerCurrentWriterIndexedByConversationId

type WriterHandlerCurrentWriterIndexedByConversationId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByConversationId) Has

type WriterHandlerCurrentWriterIndexedByKey

type WriterHandlerCurrentWriterIndexedByKey map[WriterHandlerCurrentWriterKey]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByKey) Has

type WriterHandlerCurrentWriterIndexedByOwnerId

type WriterHandlerCurrentWriterIndexedByOwnerId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByOwnerId) Has

type WriterHandlerCurrentWriterIndexedByRevision

type WriterHandlerCurrentWriterIndexedByRevision map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByRevision) Has

type WriterHandlerCurrentWriterIndexedByUpdatedAt

type WriterHandlerCurrentWriterIndexedByUpdatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUpdatedAt) Has

type WriterHandlerCurrentWriterKey

type WriterHandlerCurrentWriterKey struct {
	OwnerId        string
	ConversationId string
}

func WriterHandlerCurrentWriterIndexByKeyKey

func WriterHandlerCurrentWriterIndexByKeyKey(value *CurrentWriterView) (WriterHandlerCurrentWriterKey, bool)

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByActivationSource

func (WriterHandlerCurrentWriterSlice) GroupByActiveReportRunId

func (WriterHandlerCurrentWriterSlice) GroupByActorId

func (WriterHandlerCurrentWriterSlice) GroupByConversationId

func (WriterHandlerCurrentWriterSlice) GroupByKey

func (WriterHandlerCurrentWriterSlice) GroupByOwnerId

func (WriterHandlerCurrentWriterSlice) GroupByRevision

func (WriterHandlerCurrentWriterSlice) GroupByUpdatedAt

func (WriterHandlerCurrentWriterSlice) IndexByActivationSource

func (WriterHandlerCurrentWriterSlice) IndexByActiveReportRunId

func (WriterHandlerCurrentWriterSlice) IndexByActorId

func (WriterHandlerCurrentWriterSlice) IndexByConversationId

func (WriterHandlerCurrentWriterSlice) IndexByKey

func (WriterHandlerCurrentWriterSlice) IndexByOwnerId

func (WriterHandlerCurrentWriterSlice) IndexByRevision

func (WriterHandlerCurrentWriterSlice) IndexByUpdatedAt

type WriterHandlerReadIndexes

type WriterHandlerReadIndexes struct {
	CurrentWriter      WriterHandlerCurrentWriterSlice
	CurrentWriterByKey WriterHandlerCurrentWriterIndexedByKey
}

func BuildWriterHandlerReadIndexes

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

type WriterKeysRow

type WriterKeysRow struct {
	OwnerId        string `sqlx:"owner_id"`
	ConversationId string `sqlx:"conversation_id"`
}

Jump to

Keyboard shortcuts

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