operation

package
v0.0.0-...-c36b4a8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package operation provides types and interfaces for storage operations. It defines operation types and configurations used in transactional contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

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

Operation represents a storage operation to be executed. This is used within transactions and other operation contexts.

func Delete

func Delete(key []byte, options ...Option) Operation

Delete creates a new delete operation for the specified key. Returns an Operation configured for removing data from storage.

func Get

func Get(key []byte, options ...Option) Operation

Get creates a new read operation for the specified key. Returns an Operation configured for reading data from storage.

func Put

func Put(key, value []byte, options ...Option) Operation

Put creates a new write operation for the specified key-value pair. Returns an Operation configured for writing data to storage.

func (Operation) IsPrefix

func (o Operation) IsPrefix() bool

IsPrefix returns true if the operation is a prefix operation.

func (Operation) Key

func (o Operation) Key() []byte

Key returns the key associated with the operation.

func (Operation) Options

func (o Operation) Options() []Option

Options returns the configuration options for the operation.

func (Operation) Type

func (o Operation) Type() Type

Type returns the operation type (Get, Put, or Delete).

func (Operation) Value

func (o Operation) Value() []byte

Value returns the value associated with the operation.

type Option

type Option struct{}

Option contains configuration options for operations.

type Type

type Type int

Type represents the type of storage operation.

const (
	// TypeGet represents a read operation.
	TypeGet Type = iota
	// TypePut represents a write operation.
	TypePut
	// TypeDelete represents a delete operation.
	TypeDelete
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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