storage

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BatchSize  = 100
	PrimaryKey = "event_created_on"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Config config.Config
	Logger hclog.Logger
}

func DefaultConfig

func DefaultConfig() *Config

type Model

type Model struct {
	gorm.Model
	EventBase64    string `json:"event_base64"`
	EventCreatedOn int64  `json:"event_created_on"`
}

type Storage

type Storage interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Create(context.Context, []Model) error
	Delete(context.Context, int64, int64) error
	Read(context.Context, int64, int64) ([]Model, error)
	Update(context.Context, *Model) error
}

func New

func New(_ context.Context, cfg *Config) Storage

Jump to

Keyboard shortcuts

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