apiclient

package
v0.0.0-...-14f7cec Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package apiclient provides an interface for communicating with the Compute Accounts API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient interface {
	// UsersAndGroups fetches information about all users and groups.
	UsersAndGroups() ([]*cua.LinuxUserView, []*cua.LinuxGroupView, error)
	// AuthorizedKeys fetches the authorized SSH keys for the given
	// username.
	AuthorizedKeys(username string) (*cua.AuthorizedKeysView, error)
}

An APIClient allows fetching of accounts information from the Compute Accounts API.

func New

func New(config *Config) (APIClient, error)

New creates a new APIClient with the provided configuration.

type Config

type Config struct {
	// APIBase is the URL of the Compute Accounts API root to communicate
	// with.
	APIBase string
	// InstanceBase is the URL of the Compute API root that the instance was
	// created with.
	InstanceBase string
	// UserAgent is the user-agent string that will be sent to the Compute
	// Accounts API.
	UserAgent string
	// Timeout is the amount of time a request sent to the API has to
	// complete before it fails.
	Timeout time.Duration
}

A Config provides configuration options for an APIClient.

Jump to

Keyboard shortcuts

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