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

Documentation

Index

Constants

View Source
const WriterDatlyResourceNamespace = "reporting_artifact_write_writer"

DatlyResourceNamespace identifies this package's generated resource filesystem.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("report export artifact already exists")
	ErrNotFound      = errors.New("report export artifact or parent job not found")
	ErrConflict      = errors.New("report export artifact does not match parent job")
	ErrOwnerDenied   = errors.New("report export artifact owner denied")
)
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 WriterHandlerCurrentWriterIndexByArtifactIdKey

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

func WriterHandlerCurrentWriterIndexByArtifactRefKey

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

func WriterHandlerCurrentWriterIndexByContentTypeKey

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

func WriterHandlerCurrentWriterIndexByCreatedAtKey

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

func WriterHandlerCurrentWriterIndexByFormatKey

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

func WriterHandlerCurrentWriterIndexByJobIdKey

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

func WriterHandlerCurrentWriterIndexByOwnerIdKey

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

func WriterHandlerCurrentWriterIndexByRetentionTtlSecKey

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

Types

type Artifact

type Artifact struct {
	ShouldDelete    bool         `json:"shouldDelete,omitempty" sqlx:"-" writer:"delete"`
	ArtifactId      string       `sqlx:"artifact_id,primaryKey=true,required=true" json:"artifactId,omitempty"`
	JobId           string       `sqlx:"job_id,refTable=report_export_job,refColumn=job_id,required=true" json:"jobId,omitempty"`
	ArtifactRef     string       `sqlx:"artifact_ref,required=true" json:"artifactRef,omitempty"`
	OwnerId         string       `sqlx:"owner_id,required=true" json:"ownerId,omitempty"`
	Format          string       `sqlx:"format,required=true" json:"format,omitempty"`
	ContentType     string       `sqlx:"content_type,required=true" json:"contentType,omitempty"`
	InlineData      []byte       `sqlx:"inline_data" json:"inlineData,omitempty"`
	CreatedAt       time.Time    `sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	RetentionTtlSec int64        `sqlx:"retention_ttl_sec,required=true" json:"retentionTtlSec,omitempty"`
	Has             *ArtifactHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"ArtifactHas"`
}

Artifact is generated canonical view metadata for writer.

func (*Artifact) GetArtifactId

func (entity *Artifact) GetArtifactId() string

func (*Artifact) GetArtifactRef

func (entity *Artifact) GetArtifactRef() string

func (*Artifact) GetContentType

func (entity *Artifact) GetContentType() string

func (*Artifact) GetCreatedAt

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

func (*Artifact) GetFormat

func (entity *Artifact) GetFormat() string

func (*Artifact) GetInlineData

func (entity *Artifact) GetInlineData() []byte

func (*Artifact) GetJobId

func (entity *Artifact) GetJobId() string

func (*Artifact) GetOwnerId

func (entity *Artifact) GetOwnerId() string

func (*Artifact) GetRetentionTtlSec

func (entity *Artifact) GetRetentionTtlSec() int64

func (*Artifact) GetShouldDelete

func (entity *Artifact) GetShouldDelete() bool

func (*Artifact) SetArtifactId

func (entity *Artifact) SetArtifactId(value string)

func (*Artifact) SetArtifactRef

func (entity *Artifact) SetArtifactRef(value string)

func (*Artifact) SetContentType

func (entity *Artifact) SetContentType(value string)

func (*Artifact) SetCreatedAt

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

func (*Artifact) SetFormat

func (entity *Artifact) SetFormat(value string)

func (*Artifact) SetInlineData

func (entity *Artifact) SetInlineData(value []byte)

func (*Artifact) SetJobId

func (entity *Artifact) SetJobId(value string)

func (*Artifact) SetOwnerId

func (entity *Artifact) SetOwnerId(value string)

func (*Artifact) SetRetentionTtlSec

func (entity *Artifact) SetRetentionTtlSec(value int64)

func (*Artifact) SetShouldDelete

func (entity *Artifact) SetShouldDelete(value bool)

type ArtifactHas

type ArtifactHas struct {
	ShouldDelete    bool
	ArtifactId      bool
	JobId           bool
	ArtifactRef     bool
	OwnerId         bool
	Format          bool
	ContentType     bool
	InlineData      bool
	CreatedAt       bool
	RetentionTtlSec bool
}

type CurrentWriterView

type CurrentWriterView struct {
	ArtifactId      string    `sqlx:"artifact_id,primaryKey=true,required=true" json:"artifactId,omitempty"`
	JobId           string    `sqlx:"job_id,refTable=report_export_job,refColumn=job_id,required=true" json:"jobId,omitempty"`
	ArtifactRef     string    `sqlx:"artifact_ref,required=true" json:"artifactRef,omitempty"`
	OwnerId         string    `sqlx:"owner_id,required=true" json:"ownerId,omitempty"`
	Format          string    `sqlx:"format,required=true" json:"format,omitempty"`
	ContentType     string    `sqlx:"content_type,required=true" json:"contentType,omitempty"`
	InlineData      []byte    `sqlx:"inline_data" json:"inlineData,omitempty"`
	CreatedAt       time.Time `sqlx:"created_at,required=true" json:"createdAt,omitempty"`
	RetentionTtlSec int64     `sqlx:"retention_ttl_sec,required=true" json:"retentionTtlSec,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              `` /* 140-byte string literal not displayed */
	OrphanDelete  bool                 `parameter:"OrphanDelete,kind=orphandelete,in=enabledDelete,dataType=bool,required=false"`
	Mode          string               `parameter:"Mode,kind=query,in=mode,dataType=string,required=true"`
	ExpectedJobID string               `` /* 140-byte string literal not displayed */
	Artifacts     []*Artifact          `` /* 239-byte string literal not displayed */
	WriterKeys    []WriterKeysRow      `` /* 138-byte string literal not displayed */
	CurrentWriter []*CurrentWriterView `` /* 184-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) SetArtifacts

func (input *Input) SetArtifacts(value []*Artifact)

func (*Input) SetCurrentWriter

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

func (*Input) SetExpectedJobID

func (input *Input) SetExpectedJobID(value string)

func (*Input) SetInternal

func (input *Input) SetInternal(value bool)

func (*Input) SetMode

func (input *Input) SetMode(value string)

func (*Input) SetOrphanDelete

func (input *Input) SetOrphanDelete(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
	OrphanDelete  bool
	Mode          bool
	ExpectedJobID bool
	Artifacts     bool
	WriterKeys    bool
	CurrentWriter bool
}

type Lifecycle

type Lifecycle struct {
	Input   *Input                      `bind:"kind=input"`
	Invoker dexec.ComponentInvoker      `bind:"kind=component_invoker"`
	Starter xhandler.TransactionStarter `bind:"kind=transactionStarter"`
}

Lifecycle customizes role Input.Artifacts.

func (*Lifecycle) AfterQueue

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

func (*Lifecycle) AfterSequence

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

type Output

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

Output is the generated output scaffold for writer.

type WriterComponent

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

type WriterHandlerCurrentWriterGroupedByArtifactId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByArtifactId) Has

type WriterHandlerCurrentWriterGroupedByArtifactRef

type WriterHandlerCurrentWriterGroupedByArtifactRef map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByArtifactRef) Has

type WriterHandlerCurrentWriterGroupedByContentType

type WriterHandlerCurrentWriterGroupedByContentType map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByContentType) Has

type WriterHandlerCurrentWriterGroupedByCreatedAt

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

func (WriterHandlerCurrentWriterGroupedByCreatedAt) Has

type WriterHandlerCurrentWriterGroupedByFormat

type WriterHandlerCurrentWriterGroupedByFormat map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByFormat) Has

type WriterHandlerCurrentWriterGroupedByJobId

type WriterHandlerCurrentWriterGroupedByJobId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByJobId) Has

type WriterHandlerCurrentWriterGroupedByOwnerId

type WriterHandlerCurrentWriterGroupedByOwnerId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByOwnerId) Has

type WriterHandlerCurrentWriterGroupedByRetentionTtlSec

type WriterHandlerCurrentWriterGroupedByRetentionTtlSec map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByRetentionTtlSec) Has

type WriterHandlerCurrentWriterIndexedByArtifactId

type WriterHandlerCurrentWriterIndexedByArtifactId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByArtifactId) Has

type WriterHandlerCurrentWriterIndexedByArtifactRef

type WriterHandlerCurrentWriterIndexedByArtifactRef map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByArtifactRef) Has

type WriterHandlerCurrentWriterIndexedByContentType

type WriterHandlerCurrentWriterIndexedByContentType map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByContentType) Has

type WriterHandlerCurrentWriterIndexedByCreatedAt

type WriterHandlerCurrentWriterIndexedByCreatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByCreatedAt) Has

type WriterHandlerCurrentWriterIndexedByFormat

type WriterHandlerCurrentWriterIndexedByFormat map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByFormat) Has

type WriterHandlerCurrentWriterIndexedByJobId

type WriterHandlerCurrentWriterIndexedByJobId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByJobId) Has

type WriterHandlerCurrentWriterIndexedByOwnerId

type WriterHandlerCurrentWriterIndexedByOwnerId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByOwnerId) Has

type WriterHandlerCurrentWriterIndexedByRetentionTtlSec

type WriterHandlerCurrentWriterIndexedByRetentionTtlSec map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByRetentionTtlSec) Has

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByArtifactId

func (WriterHandlerCurrentWriterSlice) GroupByArtifactRef

func (WriterHandlerCurrentWriterSlice) GroupByContentType

func (WriterHandlerCurrentWriterSlice) GroupByCreatedAt

func (WriterHandlerCurrentWriterSlice) GroupByFormat

func (WriterHandlerCurrentWriterSlice) GroupByJobId

func (WriterHandlerCurrentWriterSlice) GroupByOwnerId

func (WriterHandlerCurrentWriterSlice) GroupByRetentionTtlSec

func (WriterHandlerCurrentWriterSlice) IndexByArtifactId

func (WriterHandlerCurrentWriterSlice) IndexByArtifactRef

func (WriterHandlerCurrentWriterSlice) IndexByContentType

func (WriterHandlerCurrentWriterSlice) IndexByCreatedAt

func (WriterHandlerCurrentWriterSlice) IndexByFormat

func (WriterHandlerCurrentWriterSlice) IndexByJobId

func (WriterHandlerCurrentWriterSlice) IndexByOwnerId

func (WriterHandlerCurrentWriterSlice) IndexByRetentionTtlSec

type WriterHandlerReadIndexes

type WriterHandlerReadIndexes struct {
	CurrentWriter             WriterHandlerCurrentWriterSlice
	CurrentWriterByArtifactId WriterHandlerCurrentWriterIndexedByArtifactId
}

func BuildWriterHandlerReadIndexes

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

type WriterKeysRow

type WriterKeysRow struct {
	ArtifactId string `sqlx:"artifact_id"`
}

Jump to

Keyboard shortcuts

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