noptions

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Options) error

Option is a closure that updates Options.

func WithAnyVersion

func WithAnyVersion() Option

Use WithAnyVersion to update documents without caring what their version is.

func WithDestination

func WithDestination(dst any) Option

WithDestination provides an interface for receiving data when getting a nosql.

func WithDestinationList

func WithDestinationList(dst []any) Option

WithDestinationList provides a interface list for receiving data when getting a nosql.

func WithMultipleSource

func WithMultipleSource(src map[string]any) Option

func WithSource

func WithSource(src any) Option

WithSource provides an interface to source data when updating a nosql.

func WithTTL

func WithTTL(ttl time.Duration) Option

Use WithTTL to set the expiration time of a nosql during an operation.

func WithVersion

func WithVersion(v Version) Option

WithVersion provides a Version value option. This is optionally used when updating documents to ensure the user has the correct version before updating.

type Options

type Options struct {
	Version         Version
	AnyVersion      bool
	TTL             time.Duration
	Source          any
	Sources         map[string]any
	Destination     any
	DestinationList []any
}

Options contains all the various options that the provided WithXyz functions construct.

func NewOptions

func NewOptions(opts ...Option) (options Options, err error)

NewOptions constructs an Options struct from the provided Option closures and returns it.

type Version

type Version = int64
const (
	NoVersion Version = 0
)

Jump to

Keyboard shortcuts

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