Documentation
¶
Overview ¶
Index ¶
Constants ¶
const (
BMCDataKey contextKey = "bmc"
)
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns a function that can be used as the ssh.Handler for the gliderlabs/ssh server.
func PubkeyAuth ¶
PubkeyAuth is a function that returns a function that can be used as a ssh.PublicKeyHandler We always return true so that the session handler can print a helpful error message to the user. The session handler must check the context for the error value and close the session if it is set.
Types ¶
type KeyValueStore ¶
type KeyValueStore struct {
// contains filtered or unexported fields
}
KeyValueStore represents an in-memory key-value store.
func NewKeyValueStore ¶
func NewKeyValueStore() *KeyValueStore
NewKeyValueStore creates a new instance of KeyValueStore.
func (*KeyValueStore) Delete ¶
func (s *KeyValueStore) Delete(key string)
Delete removes a key-value pair from the store.
func (*KeyValueStore) Get ¶
func (s *KeyValueStore) Get(key string) (*State, bool)
Get retrieves a value from the store by key.
func (*KeyValueStore) List ¶
func (s *KeyValueStore) List() map[string]*State
List retrieves all key-value pairs from the store.
func (*KeyValueStore) Set ¶
func (s *KeyValueStore) Set(key string, value *State)
Set adds or updates a key-value pair in the store.
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
MultiWriter is a writer that writes to multiple other writers.
func NewMultiWriter ¶
func NewMultiWriter(writers ...io.Writer) *MultiWriter
NewMultiWriter creates a writer that duplicates its writes to all the provided writers, similar to the Unix tee(1) command. Writers can be added and removed dynamically after creation.
Each write is written to each listed writer, one at a time. If a listed writer returns an error, that overall write operation stops and returns the error; it does not continue down the list.
func (*MultiWriter) Add ¶
func (mw *MultiWriter) Add(w io.Writer)
Add appends a writer to the list of writers this multiwriter writes to.
func (*MultiWriter) Remove ¶
func (mw *MultiWriter) Remove(w io.Writer)
Remove will remove a previously added writer from the list of writers.
type Reader ¶
type Reader interface {
FilterBMCMachine(ctx context.Context, opts data.HardwareFilter) (*data.BMCMachine, error)
}