Documentation
¶
Overview ¶
Package store keeps SSH hosts and the panel key in SQLite.
Index ¶
- Variables
- type SQLite
- func (s *SQLite) Close() error
- func (s *SQLite) Connected(ctx context.Context, id int64, hostKey string) error
- func (s *SQLite) Create(ctx context.Context, h *hosts.Host) error
- func (s *SQLite) Delete(ctx context.Context, id int64) error
- func (s *SQLite) ForgetHostKey(ctx context.Context, id int64) error
- func (s *SQLite) Get(ctx context.Context, id int64) (hosts.Host, error)
- func (s *SQLite) List(ctx context.Context) ([]hosts.Host, error)
- func (s *SQLite) SetSetting(ctx context.Context, key, value string) error
- func (s *SQLite) Setting(ctx context.Context, key string) (string, error)
- func (s *SQLite) Update(ctx context.Context, h *hosts.Host) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound reports a host that does not exist. ErrNotFound = errors.New("host not found") // ErrConflict reports a duplicate host name. ErrConflict = errors.New("a host with this name exists") )
Functions ¶
This section is empty.
Types ¶
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
SQLite stores hosts. Its tables are prefixed "ssh_", so the database can be shared with other modules. Passwords and private keys are stored as given: protect the database file.
func New ¶
New migrates the ssh_ tables in db, which the caller owns and may share with other modules.
func (*SQLite) Connected ¶
Connected records a successful connection and pins hostKey if the host had none.
func (*SQLite) ForgetHostKey ¶
ForgetHostKey clears a host's pinned key, so the next connection pins whatever the server offers.
func (*SQLite) SetSetting ¶
SetSetting stores a setting.