tapcamclient

package
v0.0.0-...-0f19a68 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tapcamclient provides a client for the tapcamd service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client is a client for the tapcamd service. It currently makes use of SFTP to upload images to tapcamd, but this may change in the future.

func New

func New(host string, options ...Option) (*Client, error)

New creates a new Client using the input host and zero or more optional Option functions.

At a minimum, the SSHUserKeyFile Option must be specified to allow authentication and image upload.

func (*Client) Close

func (c *Client) Close() error

Close closes the Client's internal network connections.

func (*Client) Upload

func (c *Client) Upload(target string, r io.Reader) error

Upload uploads a file to the target location from an input io.Reader. If r is an io.Closer, it is automatically closed once the upload completes.

type Option

type Option func(c *Client) error

An Option is a function which can apply configuration to a Client.

func SSHUserKeyFile

func SSHUserKeyFile(user string, keyFile string) Option

SSHUserKeyFile configures a Client to use an SSH username and private key file to authenticate against a tapcamd server.

Jump to

Keyboard shortcuts

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