dao

package
v0.0.0-...-aa6d52c Latest Latest
Warning

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

Go to latest
Published: Feb 20, 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 BoltDao

type BoltDao[T Model] struct {
	Db          *bbolt.DB
	BucketName  string
	Serialize   func(model T) ([]byte, error)
	Deserialize func(bytes []byte) (T, error)
}

func (BoltDao[T]) Create

func (d BoltDao[T]) Create(model T) error

func (BoltDao[T]) Delete

func (d BoltDao[T]) Delete(id string) error

func (BoltDao[T]) Get

func (d BoltDao[T]) Get(id string) (T, error)

type Dao

type Dao[T Model] interface {
	Create(model T) error
	Get(id string) (T, error)
	Delete(id string) error
}

type Model

type Model interface {
	Id() string
	SetId(id string)
}

Jump to

Keyboard shortcuts

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