storage

package
v1.4.0-beta Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package storage contains methods for interaction with database.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("readonly storage, edit ssh config directly")

Functions

This section is empty.

Types

type CombinedStorage

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

func (*CombinedStorage) Delete

func (c *CombinedStorage) Delete(hostID int) error

Delete implements HostStorage.

func (*CombinedStorage) Get

func (c *CombinedStorage) Get(hostID int) (model.Host, error)

Get implements HostStorage.

func (*CombinedStorage) GetAll

func (c *CombinedStorage) GetAll() ([]model.Host, error)

GetAll implements HostStorage. Warning: this method rebuilds the IDs.

func (*CombinedStorage) Save

func (c *CombinedStorage) Save(host model.Host) (model.Host, error)

Save implements HostStorage.

func (*CombinedStorage) Type

Type implements HostStorage.

type HostStorage

type HostStorage interface {
	GetAll() ([]model.Host, error)
	Get(hostID int) (model.Host, error)
	Save(model.Host) (model.Host, error)
	Type() constant.HostStorageEnum
	Delete(id int) error
}

HostStorage defines CRUD operations for Host model.

func Get

func Get(ctx context.Context, appConfig application.Configuration, logger iLogger) (HostStorage, error)

Get returns new data service.

type SSHConfigFile added in v1.4.0

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

func (*SSHConfigFile) Delete added in v1.4.0

func (s *SSHConfigFile) Delete(id int) error

Delete - throws not supported error.

func (*SSHConfigFile) Get added in v1.4.0

func (s *SSHConfigFile) Get(hostID int) (model.Host, error)

Get - returns host by ID.

func (*SSHConfigFile) GetAll added in v1.4.0

func (s *SSHConfigFile) GetAll() ([]model.Host, error)

GetAll - returns all hosts.

func (*SSHConfigFile) Save added in v1.4.0

func (s *SSHConfigFile) Save(host model.Host) (model.Host, error)

Save - throws not supported error.

func (*SSHConfigFile) Type added in v1.4.0

type SSHParser

type SSHParser interface {
	Parse() ([]model.Host, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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