dank

package
v0.0.0-...-b7105a7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2015 License: MIT Imports: 15 Imported by: 0

README

dank

The dank package provides a Client in order to interact with an instance of the dank service.

Documentation

Overview

The dank package provides a Client for interfacing with an instance of dank.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignOptions

type AssignOptions struct {
	types.AssignRequest
}

AssignOptions mirrors an AssignRequest but can be constructed without requiring the dank/types package

type Client

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

func NewClient

func NewClient(hostname string) *Client

NewClient retuns a new dank Client for the given hostname, the hostname will be looked up via an optimistic (if it fails we don't care) SRV record before each request.

func (*Client) Assign

func (d *Client) Assign(ar *AssignOptions) (*types.Assignment, error)

Assign gets a assignment from seaweed If you want to have no restrictions/options on the file, send a nil AssignOptions

func (*Client) Upload

func (d *Client) Upload(body []byte, a *types.Assignment) (string, error)

Upload uploads an array of bytes and uploads it to the assignment. If assignment is nil, one will be created

Returns the filename uploaded to and error.

func (*Client) UploadFile

func (d *Client) UploadFile(diskFilename string, a *types.Assignment) (string, error)

UploadFile takes a diskFilename and reads the file off the disk and uploads it using Upload

func (*Client) Verify

func (d *Client) Verify(a *types.Assignment) error

Verify takes an Assignment and validates that the signature matches a valid filename

Jump to

Keyboard shortcuts

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