write

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageName = "payload/write"
View Source
var PathURI = "/v1/api/agently/payload"

Functions

func DefineComponent

func DefineComponent(ctx context.Context, srv *datly.Service) (*repository.Component, error)

func DefineDeleteComponent

func DefineDeleteComponent(ctx context.Context, srv *datly.Service) (*repository.Component, error)

Types

type DeleteHandler

type DeleteHandler struct{}

func (*DeleteHandler) Exec

func (h *DeleteHandler) Exec(ctx context.Context, sess handler.Session) (interface{}, error)

type DeleteInput

type DeleteInput struct {
	Rows []*MutablePayloadView `parameter:",kind=body,in=data"`
}

type DeleteOutput

type DeleteOutput struct {
	response.Status `parameter:",kind=output,in=status" json:",omitempty"`
}

type Handler

type Handler struct{}

func (*Handler) Exec

func (h *Handler) Exec(ctx context.Context, sess handler.Session) (interface{}, error)

type Input

type Input struct {
	Payloads []*Payload `parameter:",kind=body,in=data"`

	CurIDs *struct{ Values []string } `parameter:",kind=param,in=Payloads,dataType=payload/write.Payloads" codec:"structql,uri=sql/cur_ids.sql"`

	Cur []*Payload `parameter:",kind=view,in=Cur" view:"Cur" sql:"uri=sql/cur_payload.sql"`

	CurByID map[string]*Payload
}

func (*Input) EmbedFS

func (i *Input) EmbedFS() (fs *embed.FS)

func (*Input) Init

func (i *Input) Init(ctx context.Context, sess handler.Session, _ *Output) error

func (*Input) Validate

func (i *Input) Validate(ctx context.Context, sess handler.Session, output *Output) error

type MutablePayloadView

type MutablePayloadView = Payload

func NewMutablePayloadView

func NewMutablePayloadView(opts ...MutablePayloadViewOption) *MutablePayloadView

type MutablePayloadViewOption

type MutablePayloadViewOption func(*MutablePayloadView)

func WithPayloadID

func WithPayloadID(v string) MutablePayloadViewOption

func WithPayloadInlineBody

func WithPayloadInlineBody(v []byte) MutablePayloadViewOption

func WithPayloadKind

func WithPayloadKind(v string) MutablePayloadViewOption

func WithPayloadMimeType

func WithPayloadMimeType(v string) MutablePayloadViewOption

func WithPayloadSizeBytes

func WithPayloadSizeBytes(v int) MutablePayloadViewOption

func WithPayloadStorage

func WithPayloadStorage(v string) MutablePayloadViewOption

type MutablePayloadViews

type MutablePayloadViews struct {
	Payloads []*MutablePayloadView
}

func NewMutablePayloadViews

func NewMutablePayloadViews(rows ...*MutablePayloadView) *MutablePayloadViews

type Output

type Output struct {
	response.Status `parameter:",kind=output,in=status" anonymous:"true"`
	Data            []*Payload             `parameter:",kind=body"`
	Violations      []*validator.Violation `parameter:",kind=transient"`
}

type Payload

type Payload struct {
	Id                     string      `sqlx:"id,primaryKey" validate:"required"`
	TenantID               *string     `sqlx:"tenant_id" json:",omitempty"`
	Kind                   string      `sqlx:"kind" validate:"required"`
	Subtype                *string     `sqlx:"subtype" json:",omitempty"`
	MimeType               string      `sqlx:"mime_type" validate:"required"`
	SizeBytes              int         `sqlx:"size_bytes" validate:"required"`
	Digest                 *string     `sqlx:"digest" json:",omitempty"`
	Storage                string      `sqlx:"storage" validate:"required"`
	InlineBody             *[]byte     `sqlx:"inline_body" json:",omitempty"`
	URI                    *string     `sqlx:"uri" json:",omitempty"`
	Compression            string      `sqlx:"compression"`
	EncryptionKMSKeyID     *string     `sqlx:"encryption_kms_key_id" json:",omitempty"`
	RedactionPolicyVersion *string     `sqlx:"redaction_policy_version" json:",omitempty"`
	Redacted               *int        `sqlx:"redacted" json:",omitempty"`
	CreatedAt              *time.Time  `sqlx:"created_at" json:",omitempty"`
	SchemaRef              *string     `sqlx:"schema_ref" json:",omitempty"`
	Has                    *PayloadHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func (*Payload) SetCompression

func (p *Payload) SetCompression(v string)

func (*Payload) SetId

func (p *Payload) SetId(v string)

func (*Payload) SetInlineBody

func (p *Payload) SetInlineBody(v []byte)

func (*Payload) SetKind

func (p *Payload) SetKind(v string)

func (*Payload) SetMimeType

func (p *Payload) SetMimeType(v string)

func (*Payload) SetSizeBytes

func (p *Payload) SetSizeBytes(v int)

func (*Payload) SetStorage

func (p *Payload) SetStorage(v string)

func (*Payload) SetURI

func (p *Payload) SetURI(v string)

type PayloadHas

type PayloadHas struct {
	Id                     bool
	TenantID               bool
	Kind                   bool
	Subtype                bool
	MimeType               bool
	SizeBytes              bool
	Digest                 bool
	Storage                bool
	InlineBody             bool
	URI                    bool
	Compression            bool
	EncryptionKMSKeyID     bool
	RedactionPolicyVersion bool
	Redacted               bool
	CreatedAt              bool
	SchemaRef              bool
}

Jump to

Keyboard shortcuts

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