storage

package
v0.0.0-...-25dc0e1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Create(context.Context, *model.Server) (*model.Server, error)
	List(context.Context) ([]*model.Server, error)
	GetByName(context.Context, string) (*model.Server, error)
	GetByID(context.Context, uuid.UUID) (*model.Server, error)
	Delete(context.Context, uuid.UUID) error
	Update(context.Context, *model.Server) error
	Save() error
}

type ServerStorage

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

func NewServerStorage

func NewServerStorage(ctx context.Context, filename string) (*ServerStorage, error)

func (*ServerStorage) Create

func (s *ServerStorage) Create(ctx context.Context, server *model.Server) (*model.Server, error)

func (*ServerStorage) Delete

func (s *ServerStorage) Delete(ctx context.Context, ID uuid.UUID) error

func (*ServerStorage) GetByID

func (s *ServerStorage) GetByID(ctx context.Context, id uuid.UUID) (*model.Server, error)

func (*ServerStorage) GetByName

func (s *ServerStorage) GetByName(ctx context.Context, name string) (*model.Server, error)

func (*ServerStorage) List

func (s *ServerStorage) List(ctx context.Context) ([]*model.Server, error)

func (*ServerStorage) Save

func (s *ServerStorage) Save() error

func (*ServerStorage) Update

func (s *ServerStorage) Update(ctx context.Context, server *model.Server) error

Jump to

Keyboard shortcuts

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