Documentation
¶
Overview ¶
Package storage contains methods for interaction with database.
Index ¶
- Variables
- type HostStorage
- type SSHConfigFile
- func (s *SSHConfigFile) Close()
- func (s *SSHConfigFile) Delete(_ int) error
- func (s *SSHConfigFile) Get(hostID int) (model.Host, error)
- func (s *SSHConfigFile) GetAll() ([]model.Host, error)
- func (s *SSHConfigFile) Save(host model.Host) (model.Host, error)
- func (s *SSHConfigFile) Type() constant.HostStorageEnum
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupported = errors.New("readonly storage, edit ssh config directly")
ErrNotSupported - is an error which is returned when trying to save or delete host in SSHConfigFile storage.
Functions ¶
This section is empty.
Types ¶
type HostStorage ¶
type HostStorage interface {
GetAll() ([]model.Host, error)
Get(hostID int) (model.Host, error)
Save(model.Host) (model.Host, error)
Delete(id int) error
Type() constant.HostStorageEnum
Close()
}
HostStorage defines CRUD operations for Host model.
func Initialize ¶ added in v1.5.0
Initialize - prepares inner storages and returns a common HostStorage interface to load and save hosts.
type SSHConfigFile ¶ added in v1.4.0
type SSHConfigFile struct {
// contains filtered or unexported fields
}
SSHConfigFile - is a storage which contains hosts loaded from SSH config file.
func (*SSHConfigFile) Close ¶ added in v1.5.0
func (s *SSHConfigFile) Close()
func (*SSHConfigFile) Delete ¶ added in v1.4.0
func (s *SSHConfigFile) Delete(_ 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) Type ¶ added in v1.4.0
func (s *SSHConfigFile) Type() constant.HostStorageEnum
Type - returns storage type.
Click to show internal directories.
Click to hide internal directories.