storj

package module
v0.0.0-...-8549b6d Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: MIT Imports: 12 Imported by: 0

README

storj

Build Status

A Go client library for the Storj Bridge API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	User     string    `json:"user"`
	PubKeys  []string  `json:"pubkeys"`
	Status   string    `json:"status"`
	Created  time.Time `json:"created"`
	Storage  int       `json:"storage"`
	Transfer int       `json:"transfer"`
}

type BucketService

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

func (*BucketService) Delete

func (s *BucketService) Delete(bucketID string) error

func (*BucketService) Get

func (s *BucketService) Get(bucketID string) (*Bucket, error)

func (*BucketService) List

func (s *BucketService) List() ([]Bucket, error)

func (*BucketService) New

func (s *BucketService) New(name string, storage, transfer int) (*Bucket, error)

type Client

type Client struct {
	BaseURL *url.URL
	AuthKey *btcec.PrivateKey

	Keys     KeyService
	Files    FileService
	Tokens   TokenService
	Buckets  BucketService
	Contacts ContactService
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, into interface{}) (*http.Response, error)

func (*Client) LoadAuthKey

func (c *Client) LoadAuthKey(fileName string) error

func (*Client) Sign

func (c *Client) Sign(msg []byte) (string, error)

type Contact

type Contact struct {
	Address  string    `json:"address"`
	Port     int       `json:"port"`
	NodeID   string    `json:"nodeID"`
	LastSeen time.Time `json:"lastSeen"`
	Protocol string    `json:"protocol"`
}

type ContactService

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

func (*ContactService) Get

func (s *ContactService) Get(nodeID string) (*Contact, error)

func (*ContactService) List

func (s *ContactService) List() ([]Contact, error)

type Farmer

type Farmer struct {
	Address  string `json:"address"`
	LastSeen int64  `json:"lastSeen"`
	NodeID   string `json:"nodeID"`
	Port     int    `json:"port"`
	Protocol string `json:"protocol"`
}

type File

type File struct {
	ID       string `json:"id"`
	Bucket   string `json:"bucket"`
	MimeType string `json:"mimetype"`
	Name     string `json:"filename"`
	Size     int64  `json:"size"`
	Frame    string `json:"frame"`
}

type FilePointer

type FilePointer struct {
	Hash      string `json:"hash"`
	Token     string `json:"token"`
	Operation string `json:"operation"`
	Farmer    Farmer `json:"farmer"`
}

type FileService

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

func (*FileService) Delete

func (s *FileService) Delete(bucketID, fileID string) error

func (*FileService) List

func (s *FileService) List(bucketID string) ([]File, error)

func (*FileService) ListPointers

func (s *FileService) ListPointers(bucketID, fileID, token string) ([]FilePointer, error)

type Key

type Key struct {
	Key  string `json:"key"`
	User string `json:"user"`
}

type KeyService

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

func (*KeyService) Delete

func (s *KeyService) Delete(key string) error

func (*KeyService) List

func (s *KeyService) List() ([]Key, error)

func (*KeyService) Register

func (s *KeyService) Register(key string) error

type Token

type Token struct {
	Token     string    `json:"token"`
	Bucket    string    `json:"bucket"`
	Expires   time.Time `json:"expires"`
	Operation string    `json:"operation"`
}

type TokenService

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

func (*TokenService) New

func (s *TokenService) New(operation, bucketID string) (*Token, error)

Jump to

Keyboard shortcuts

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