client

package
v0.0.0-...-2ba466c Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ApiKey    string
	ApiHost   string
	ApiClient *resty.Client
	// ApiComment is used to add extra info (like user that performed the action) to keyserver log
	ApiComment string
	Host       string
	Port       string
	User       string
}

func NewClient

func NewClient(apiHost, apiKey string) *Client

func (*Client) AddGroup

func (c *Client) AddGroup(g group.Group) (*group.Group, error)

func (*Client) AddKey

func (c *Client) AddKey(user passwd.User, key authorized_keys.SSHKey) error

func (*Client) AddUser

func (c *Client) AddUser(user passwd.User, createHome bool) (*passwd.User, error)

func (*Client) ClearGroupCache

func (c *Client) ClearGroupCache() error

func (*Client) ClearUserCache

func (c *Client) ClearUserCache() error

func (*Client) CreateHome

func (c *Client) CreateHome(user passwd.User) (*passwd.User, error)

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(g group.Group) (*group.Group, error)

func (*Client) DeleteKey

func (c *Client) DeleteKey(user passwd.User, key authorized_keys.SSHKey) error

func (*Client) DeleteUser

func (c *Client) DeleteUser(user passwd.User, removeHome bool) (*passwd.User, error)

func (*Client) Execute

func (c *Client) Execute(method string, request, result interface{}) (interface{}, error)

func (*Client) FindGroup

func (c *Client) FindGroup(g group.Group) (*group.Group, error)

func (*Client) FindKey

func (c *Client) FindKey(user passwd.User, key authorized_keys.SSHKey) (*authorized_keys.SSHKey, error)

func (*Client) FindUser

func (c *Client) FindUser(user passwd.User) (*passwd.User, error)

func (*Client) GetGroups

func (c *Client) GetGroups() ([]group.Group, error)

func (*Client) GetKeys

func (c *Client) GetKeys(user passwd.User) ([]authorized_keys.SSHKey, error)

func (*Client) GetURL

func (c *Client) GetURL(method string) string

func (*Client) GetUserByName

func (c *Client) GetUserByName(name string) (*passwd.User, error)

func (*Client) GetUserByUid

func (c *Client) GetUserByUid(uid string) (*passwd.User, error)

func (*Client) GetUsers

func (c *Client) GetUsers() ([]passwd.User, error)

func (*Client) R

func (c *Client) R() *resty.Request

func (*Client) WithConfig

func (c *Client) WithConfig(host, port, user string) *Client

func (*Client) WriteKeys

func (c *Client) WriteKeys(user passwd.User, keys []authorized_keys.SSHKey) error

Jump to

Keyboard shortcuts

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