backend

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(conn SFTP) *config

initConfig reads in config file and ENV variables if set.

Types

type Group

type Group struct {
	Users   []string
	Servers []string
}

type Hostentry

type Hostentry struct {
	Host     string   `json:"host"`
	User     string   `json:"user"`
	Key      string   `json:"key"`
	Checksum string   `json:"checksum"`
	Users    []string `json:"users"`
	Groups   []string `json:"groups"`
	Alias    string   `json:"-"`
	Config   *config  `json:"-"`
}

func (*Hostentry) GetUsers

func (h *Hostentry) GetUsers() []string

func (*Hostentry) UpdateGroups

func (h *Hostentry) UpdateGroups(c *config, oldgroups []string) error

type SFTP

type SFTP interface {
	Connect(keyfile, host, user string) error
	Write(data string) error
	Read() ([]byte, error)
	Close()
}

type SFTPConn

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

func NewSFTP

func NewSFTP() *SFTPConn

func (*SFTPConn) Close

func (s *SFTPConn) Close()

func (*SFTPConn) Connect

func (s *SFTPConn) Connect(keyfile, host, user string) error

func (*SFTPConn) Read

func (s *SFTPConn) Read() ([]byte, error)

func (*SFTPConn) Write

func (s *SFTPConn) Write(data string) error

type User

type User struct {
	KeyType string   `json:"type"`
	Name    string   `json:"name"`
	Email   string   `json:"email"`
	Key     string   `json:"key"`
	Groups  []string `json:"groups"`
}

func (*User) UpdateGroups

func (u *User) UpdateGroups(C *config, oldgroups []string) error

Jump to

Keyboard shortcuts

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