notestorage

package
v0.0.0-...-783ed30 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoteKindEmptyError = &tracer.Error{
	Kind: "NoteKindEmptyError",
	Desc: "The request expects the note kind not to be empty. The note kind was found to be empty. Therefore the request failed.",
}
View Source
var NoteObjectNotFoundError = &tracer.Error{
	Kind: "NoteObjectNotFoundError",
	Desc: "The request expects a note object to exist. The note object was not found to exist. Therefore the request failed.",
}
View Source
var NoteOwnerEmptyError = &tracer.Error{
	Kind: "NoteOwnerEmptyError",
	Desc: "The request expects the note owner not to be empty. The note owner was found to be empty. Therefore the request failed.",
}

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// CreateNote persists new note objects in the underlying storage.
	//
	//     @inp[0] the note objects to create
	//
	CreateNote([]*Object) error

	// SearchPage returns the note objects within the given pagination range in
	// reversed order of claim creation time. Given the indexed notes [A B C D E],
	// the first page [0 3] returns the most recent notes [C D E].
	//
	//     @inp[0] the user ID to search notes for
	//     @inp[1] the start paging pointer defining the beginning of the page
	//     @inp[2] the stop paging pointer defining the end of the page
	//     @out[0] the list of note objects within the given pagination range
	//
	SearchPage(objectid.ID, int, int) ([]*Object, error)

	// SearchTime returns the note objects within the given pagination range of
	// creation time. Given the indexed notes [A B C D E], the time range
	// [1730761200 1730847600] returns the respective notes [B C D].
	//
	//     @inp[0] the user ID to search notes for
	//     @inp[1] the start unix timestamp defining the beginning of the page
	//     @inp[2] the stop unix timestamp defining the end of the page
	//     @out[0] the list of note objects within the given pagination range
	//
	SearchTime(objectid.ID, int64, int64) ([]*Object, error)
}

func Fake

func Fake() Interface

type Object

type Object struct {
	Created  time.Time   `json:"created,omitempty"`
	ID       objectid.ID `json:"id,omitempty"`
	Kind     string      `json:"kind,omitempty"`
	Message  string      `json:"message,omitempty"`
	Owner    objectid.ID `json:"owner,omitempty"`
	Resource objectid.ID `json:"resource,omitempty"`
}

func (*Object) Verify

func (o *Object) Verify() error

type Redigo

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

func NewRedigo

func NewRedigo(c RedigoConfig) *Redigo

func (*Redigo) CreateNote

func (r *Redigo) CreateNote(inp []*Object) error

func (*Redigo) SearchNote

func (r *Redigo) SearchNote(inp []objectid.ID) ([]*Object, error)

func (*Redigo) SearchPage

func (r *Redigo) SearchPage(use objectid.ID, beg int, end int) ([]*Object, error)

func (*Redigo) SearchTime

func (r *Redigo) SearchTime(use objectid.ID, beg int64, end int64) ([]*Object, error)

type RedigoConfig

type RedigoConfig struct {
	Log logger.Interface
	Red redigo.Interface
}

type Slicer

type Slicer []*Object

func (Slicer) Kind

func (s Slicer) Kind() []string

func (Slicer) ObjectKind

func (s Slicer) ObjectKind(kin []string) Slicer

Jump to

Keyboard shortcuts

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