batchutils

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchGet added in v1.5.0

BatchGet gets a slice of keys from the cache, returning a map from failing cache keys to their specific errors.

func BatchSet added in v1.10.0

BatchSet sets a slice of keys to the cache, returning a map from failing cache keys to their specific errors.

func BatchSetIfNotExists added in v1.11.0

BatchSetIfNotExists will set the key-value pairs ONLY if all keys don't already exist

func CreateErrorMapping added in v1.11.0

func CreateErrorMapping(keys []momento.Key, err error) map[momento.Key]error

func ExtractKeys added in v1.11.0

func ExtractKeys(items Items) []momento.Key

Types

type BatchDeleteError

type BatchDeleteError struct {
	// contains filtered or unexported fields
}

BatchDeleteError contains a map associating failing cache keys with their specific errors. It may be necessary to use a type assertion to access the errors:

errors := (err.(*BatchDeleteError)).Errors()

func BatchDelete

func BatchDelete(ctx context.Context, props *BatchDeleteRequest) *BatchDeleteError

BatchDelete deletes a slice of keys from the cache, returning a map from failing cache keys to their specific errors.

func (*BatchDeleteError) Error

func (e *BatchDeleteError) Error() string

func (*BatchDeleteError) Errors

func (e *BatchDeleteError) Errors() map[momento.Value]error

type BatchDeleteRequest

type BatchDeleteRequest struct {
	Client               momento.CacheClient
	CacheName            string
	Keys                 []momento.Key
	MaxConcurrentDeletes int
	// timeout for individual requests, defaults to 10 seconds
	RequestTimeout *time.Duration
}

type BatchGetError added in v1.5.0

type BatchGetError struct {
	// contains filtered or unexported fields
}

BatchGetError contains a map associating failing cache keys with their specific errors. It may be necessary to use a type assertion to access the errors:

errors := (err.(*BatchGetError)).Errors()

func (*BatchGetError) Error added in v1.5.0

func (e *BatchGetError) Error() string

func (*BatchGetError) Errors added in v1.5.0

func (e *BatchGetError) Errors() map[momento.Value]error

type BatchGetRequest added in v1.5.0

type BatchGetRequest struct {
	Client            momento.CacheClient
	CacheName         string
	Keys              []momento.Key
	MaxConcurrentGets int
	// timeout for individual requests, defaults to 10 seconds
	RequestTimeout *time.Duration
}

type BatchGetResponse added in v1.5.0

type BatchGetResponse struct {
	// contains filtered or unexported fields
}

BatchGetResponse contains a map associating successful get responses with their cache keys.

func (*BatchGetResponse) Responses added in v1.5.0

func (e *BatchGetResponse) Responses() map[momento.Value]responses.GetResponse

type BatchSetError added in v1.10.0

type BatchSetError struct {
	// contains filtered or unexported fields
}

BatchSetError contains a map associating failing cache keys with their specific errors. It may be necessary to use a type assertion to access the errors:

errors := (err.(*BatchSetError)).Errors()

func (*BatchSetError) Error added in v1.10.0

func (e *BatchSetError) Error() string

func (*BatchSetError) Errors added in v1.10.0

func (e *BatchSetError) Errors() map[momento.Value]error

Errors contains a map associating unsuccessful set errors with their cache keys.

type BatchSetIfNotExistsError added in v1.11.0

type BatchSetIfNotExistsError struct {
	// contains filtered or unexported fields
}

BatchSetIfNotExistsError contains a map associating failing cache keys with their specific errors. Errors may be related to keys already existing or batch set failing. It may be necessary to use a type assertion to access the errors:

errors := (err.(*BatchSetIfNotExistsError)).Errors()

func (*BatchSetIfNotExistsError) Error added in v1.11.0

func (e *BatchSetIfNotExistsError) Error() string

func (*BatchSetIfNotExistsError) Errors added in v1.11.0

func (e *BatchSetIfNotExistsError) Errors() map[momento.Key]error

Errors contains a map associating errors with their cache keys.

type BatchSetIfNotExistsNotStored added in v1.11.0

type BatchSetIfNotExistsNotStored struct{}

BatchSetIfNotExistsNotStored indicates a successful set request where the value was already present.

type BatchSetIfNotExistsRequest added in v1.11.0

type BatchSetIfNotExistsRequest struct {
	Client            momento.CacheClient
	CacheName         string
	Items             []BatchSetItem
	MaxConcurrentSets int
	// timeout for individual requests, defaults to 10 seconds
	RequestTimeout *time.Duration
}

type BatchSetIfNotExistsResponse added in v1.11.0

type BatchSetIfNotExistsResponse interface {
	// contains filtered or unexported methods
}

BatchSetIfNotExistsResponse is the base response type for a BatchSetIfNotExists request

type BatchSetIfNotExistsStored added in v1.11.0

type BatchSetIfNotExistsStored struct {
	// contains filtered or unexported fields
}

BatchSetIfNotExistsStored indicates a successful set request where the value was stored.

func (BatchSetIfNotExistsStored) Responses added in v1.11.0

type BatchSetItem added in v1.10.0

type BatchSetItem struct {
	Key   momento.Key
	Value momento.Value
	Ttl   time.Duration
}

type BatchSetRequest added in v1.10.0

type BatchSetRequest struct {
	Client            momento.CacheClient
	CacheName         string
	Items             []BatchSetItem
	MaxConcurrentSets int
	// timeout for individual requests, defaults to 10 seconds
	RequestTimeout *time.Duration
}

type BatchSetResponse added in v1.10.0

type BatchSetResponse struct {
	// contains filtered or unexported fields
}

BatchSetResponse contains a map associating successful set responses with their cache keys.

func (*BatchSetResponse) Responses added in v1.10.0

func (e *BatchSetResponse) Responses() map[momento.Value]responses.SetResponse

type Items added in v1.11.0

type Items []BatchSetItem

Jump to

Keyboard shortcuts

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