database

package
v0.0.0-...-b95f9bb Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProductDataBase = Database[*models.Product]{}

T = *models.Product

Functions

This section is empty.

Types

type Database

type Database[T Identifiable] struct {
	// contains filtered or unexported fields
}

func (*Database[T]) Add

func (d *Database[T]) Add(data T)

func (*Database[T]) Delete

func (d *Database[T]) Delete(id int)

func (*Database[T]) Get

func (d *Database[T]) Get(id int) (ret T, err error)

func (*Database[T]) GetAll

func (d *Database[T]) GetAll() []T

func (*Database[T]) Update

func (d *Database[T]) Update(data T)

type Identifiable

type Identifiable interface {
	GetId() int
	SetId(int)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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