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

Documentation

Index

Constants

View Source
const WriterDatlyResourceNamespace = "oauth_token_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 WriterHandlerCurrentWriterIndexByEncTokenKey

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

func WriterHandlerCurrentWriterIndexByLeaseOwnerKey

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

func WriterHandlerCurrentWriterIndexByLeaseUntilKey

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

func WriterHandlerCurrentWriterIndexByProviderKey

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

func WriterHandlerCurrentWriterIndexByRefreshStatusKey

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

func WriterHandlerCurrentWriterIndexByUpdatedAtKey

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

func WriterHandlerCurrentWriterIndexByUserIdKey

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

func WriterHandlerCurrentWriterIndexByVersionKey

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

Types

type CurrentWriterView

type CurrentWriterView struct {
	UserId        string     `sqlx:"user_id,primaryKey,refTable=users,refColumn=id,required=true" json:"userId,omitempty"`
	Provider      string     `sqlx:"provider,primaryKey,required=true" json:"provider,omitempty"`
	EncToken      string     `json:"encToken,omitempty" sqlx:"enc_token,required=true"`
	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"`
	Version       int64      `json:"version" sqlx:"version,required=true"`
	RefreshStatus string     `json:"refreshStatus" sqlx:"refresh_status,required=true"`
	LeaseOwner    *string    `json:"leaseOwner" sqlx:"lease_owner"`
	LeaseUntil    *time.Time `json:"leaseUntil" sqlx:"lease_until"`
}

CurrentWriterView is generated canonical view metadata for writer.

type Input

type Input struct {
	Token              *Token               `` /* 191-byte string literal not displayed */
	Mode               string               `parameter:"Mode,kind=query,in=mode,dataType=string,required=false"`
	ExpectedVersion    int64                `` /* 138-byte string literal not displayed */
	ExpectedLeaseOwner string               `` /* 149-byte string literal not displayed */
	ExpectedEncToken   string               `` /* 143-byte string literal not displayed */
	LeaseMode          string               `` /* 179-byte string literal not displayed */
	WriterKeys         []WriterKeysRow      `` /* 127-byte string literal not displayed */
	CurrentWriter      []*CurrentWriterView `` /* 171-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) Init

func (input *Input) Init(ctx context.Context) error

Init keeps mutation modes on an existing composite identity. Missing rows are no-ops for clear/release/CAS instead of becoming incomplete inserts.

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) SetExpectedEncToken

func (input *Input) SetExpectedEncToken(value string)

func (*Input) SetExpectedLeaseOwner

func (input *Input) SetExpectedLeaseOwner(value string)

func (*Input) SetExpectedVersion

func (input *Input) SetExpectedVersion(value int64)

func (*Input) SetLeaseMode

func (input *Input) SetLeaseMode(value string)

func (*Input) SetMode

func (input *Input) SetMode(value string)

func (*Input) SetToken

func (input *Input) SetToken(value *Token)

func (*Input) SetWriterKeys

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

type InputHas

type InputHas struct {
	Token              bool
	Mode               bool
	ExpectedVersion    bool
	ExpectedLeaseOwner bool
	ExpectedEncToken   bool
	LeaseMode          bool
	WriterKeys         bool
	CurrentWriter      bool
}

type Lifecycle

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

Lifecycle customizes role Input.Token.

func (*Lifecycle) AfterQueue

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

func (*Lifecycle) AfterSequence

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

type Output

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

Output is the generated output scaffold for writer.

type Token

type Token struct {
	UserId        string     `sqlx:"user_id,primaryKey,refTable=users,refColumn=id,required=true" json:"userId,omitempty"`
	Provider      string     `sqlx:"provider,primaryKey,required=true" json:"provider,omitempty"`
	EncToken      string     `json:"encToken,omitempty" sqlx:"enc_token,required=true"`
	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"`
	Version       int64      `json:"version" sqlx:"version,required=true"`
	RefreshStatus string     `json:"refreshStatus" sqlx:"refresh_status,required=true"`
	LeaseOwner    *string    `json:"leaseOwner" sqlx:"lease_owner"`
	LeaseUntil    *time.Time `json:"leaseUntil" sqlx:"lease_until"`
	Has           *TokenHas  `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"TokenHas"`
}

Token is generated canonical view metadata for writer.

func (*Token) GetCreatedAt

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

func (*Token) GetEncToken

func (entity *Token) GetEncToken() string

func (*Token) GetLeaseOwner

func (entity *Token) GetLeaseOwner() *string

func (*Token) GetLeaseUntil

func (entity *Token) GetLeaseUntil() *time.Time

func (*Token) GetProvider

func (entity *Token) GetProvider() string

func (*Token) GetRefreshStatus

func (entity *Token) GetRefreshStatus() string

func (*Token) GetUpdatedAt

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

func (*Token) GetUserId

func (entity *Token) GetUserId() string

func (*Token) GetVersion

func (entity *Token) GetVersion() int64

func (*Token) SetCreatedAt

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

func (*Token) SetEncToken

func (entity *Token) SetEncToken(value string)

func (*Token) SetLeaseOwner

func (entity *Token) SetLeaseOwner(value *string)

func (*Token) SetLeaseUntil

func (entity *Token) SetLeaseUntil(value *time.Time)

func (*Token) SetProvider

func (entity *Token) SetProvider(value string)

func (*Token) SetRefreshStatus

func (entity *Token) SetRefreshStatus(value string)

func (*Token) SetUpdatedAt

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

func (*Token) SetUserId

func (entity *Token) SetUserId(value string)

func (*Token) SetVersion

func (entity *Token) SetVersion(value int64)

type TokenHas

type TokenHas struct {
	UserId        bool
	Provider      bool
	EncToken      bool
	CreatedAt     bool
	UpdatedAt     bool
	Version       bool
	RefreshStatus bool
	LeaseOwner    bool
	LeaseUntil    bool
}

type WriterComponent

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

type WriterHandlerCurrentWriterGroupedByEncToken map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByEncToken) Has

type WriterHandlerCurrentWriterGroupedByKey

type WriterHandlerCurrentWriterGroupedByKey map[WriterHandlerCurrentWriterKey][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByKey) Has

type WriterHandlerCurrentWriterGroupedByLeaseOwner

type WriterHandlerCurrentWriterGroupedByLeaseOwner map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByLeaseOwner) Has

type WriterHandlerCurrentWriterGroupedByLeaseUntil

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

func (WriterHandlerCurrentWriterGroupedByLeaseUntil) Has

type WriterHandlerCurrentWriterGroupedByProvider

type WriterHandlerCurrentWriterGroupedByProvider map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByProvider) Has

type WriterHandlerCurrentWriterGroupedByRefreshStatus

type WriterHandlerCurrentWriterGroupedByRefreshStatus map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByRefreshStatus) Has

type WriterHandlerCurrentWriterGroupedByUpdatedAt

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

func (WriterHandlerCurrentWriterGroupedByUpdatedAt) Has

type WriterHandlerCurrentWriterGroupedByUserId

type WriterHandlerCurrentWriterGroupedByUserId map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByUserId) Has

type WriterHandlerCurrentWriterGroupedByVersion

type WriterHandlerCurrentWriterGroupedByVersion map[int64][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedByVersion) Has

type WriterHandlerCurrentWriterIndexedByCreatedAt

type WriterHandlerCurrentWriterIndexedByCreatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByCreatedAt) Has

type WriterHandlerCurrentWriterIndexedByEncToken

type WriterHandlerCurrentWriterIndexedByEncToken map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByEncToken) Has

type WriterHandlerCurrentWriterIndexedByKey

type WriterHandlerCurrentWriterIndexedByKey map[WriterHandlerCurrentWriterKey]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByKey) Has

type WriterHandlerCurrentWriterIndexedByLeaseOwner

type WriterHandlerCurrentWriterIndexedByLeaseOwner map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByLeaseOwner) Has

type WriterHandlerCurrentWriterIndexedByLeaseUntil

type WriterHandlerCurrentWriterIndexedByLeaseUntil map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByLeaseUntil) Has

type WriterHandlerCurrentWriterIndexedByProvider

type WriterHandlerCurrentWriterIndexedByProvider map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByProvider) Has

type WriterHandlerCurrentWriterIndexedByRefreshStatus

type WriterHandlerCurrentWriterIndexedByRefreshStatus map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByRefreshStatus) Has

type WriterHandlerCurrentWriterIndexedByUpdatedAt

type WriterHandlerCurrentWriterIndexedByUpdatedAt map[time.Time]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUpdatedAt) Has

type WriterHandlerCurrentWriterIndexedByUserId

type WriterHandlerCurrentWriterIndexedByUserId map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByUserId) Has

type WriterHandlerCurrentWriterIndexedByVersion

type WriterHandlerCurrentWriterIndexedByVersion map[int64]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedByVersion) Has

type WriterHandlerCurrentWriterKey

type WriterHandlerCurrentWriterKey struct {
	UserId   string
	Provider string
}

func WriterHandlerCurrentWriterIndexByKeyKey

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

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupByCreatedAt

func (WriterHandlerCurrentWriterSlice) GroupByEncToken

func (WriterHandlerCurrentWriterSlice) GroupByKey

func (WriterHandlerCurrentWriterSlice) GroupByLeaseOwner

func (WriterHandlerCurrentWriterSlice) GroupByLeaseUntil

func (WriterHandlerCurrentWriterSlice) GroupByProvider

func (WriterHandlerCurrentWriterSlice) GroupByRefreshStatus

func (WriterHandlerCurrentWriterSlice) GroupByUpdatedAt

func (WriterHandlerCurrentWriterSlice) GroupByUserId

func (WriterHandlerCurrentWriterSlice) GroupByVersion

func (WriterHandlerCurrentWriterSlice) IndexByCreatedAt

func (WriterHandlerCurrentWriterSlice) IndexByEncToken

func (WriterHandlerCurrentWriterSlice) IndexByKey

func (WriterHandlerCurrentWriterSlice) IndexByLeaseOwner

func (WriterHandlerCurrentWriterSlice) IndexByLeaseUntil

func (WriterHandlerCurrentWriterSlice) IndexByProvider

func (WriterHandlerCurrentWriterSlice) IndexByRefreshStatus

func (WriterHandlerCurrentWriterSlice) IndexByUpdatedAt

func (WriterHandlerCurrentWriterSlice) IndexByUserId

func (WriterHandlerCurrentWriterSlice) IndexByVersion

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 {
	UserId   string `sqlx:"user_id"`
	Provider string `sqlx:"provider"`
}

Jump to

Keyboard shortcuts

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