uplink

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is the errs class of standard End User Client errors
	Error = errs.Class("Uplink configuration error")
)

Functions

func LoadEncryptionKey added in v0.12.0

func LoadEncryptionKey(filepath string) (key *storj.Key, error error)

LoadEncryptionKey loads the encryption key stored in the file pointed by filepath.

An error is file is not found or there is an I/O error.

func SaveEncryptionKey added in v0.13.0

func SaveEncryptionKey(inputKey string, filepath string) error

SaveEncryptionKey generates a Storj key from the inputKey and save it into a new file created in filepath.

Types

type ClientConfig

type ClientConfig struct {
	APIKey         string        `default:"" help:"the api key to use for the satellite" noprefix:"true"`
	SatelliteAddr  string        `releaseDefault:"127.0.0.1:7777" devDefault:"127.0.0.1:10000" help:"the address to use for the satellite" noprefix:"true"`
	MaxInlineSize  memory.Size   `help:"max inline segment size in bytes" default:"4KiB"`
	SegmentSize    memory.Size   `help:"the size of a segment in bytes" default:"64MiB"`
	RequestTimeout time.Duration `help:"timeout for request" default:"0h0m20s"`
	DialTimeout    time.Duration `help:"timeout for dials" default:"0h0m20s"`
}

ClientConfig is a configuration struct for the uplink that controls how to talk to the rest of the network.

type Config

type Config struct {
	Client ClientConfig
	RS     RSConfig
	Enc    EncryptionConfig
	TLS    tlsopts.Config
}

Config uplink configuration

func (Config) GetEncryptionScheme

func (c Config) GetEncryptionScheme() storj.EncryptionScheme

GetEncryptionScheme returns the configured encryption scheme for new uploads

func (Config) GetMetainfo

func (c Config) GetMetainfo(ctx context.Context, identity *identity.FullIdentity) (db storj.Metainfo, ss streams.Store, err error)

GetMetainfo returns an implementation of storj.Metainfo

func (Config) GetPathCipherSuite added in v0.13.0

func (c Config) GetPathCipherSuite() storj.CipherSuite

GetPathCipherSuite returns the cipher suite used for path encryption for bucket objects

func (Config) GetRedundancyScheme

func (c Config) GetRedundancyScheme() storj.RedundancyScheme

GetRedundancyScheme returns the configured redundancy scheme for new uploads

func (Config) GetSegmentSize added in v0.13.0

func (c Config) GetSegmentSize() memory.Size

GetSegmentSize returns the segment size set in uplink config

type EncryptionConfig

type EncryptionConfig struct {
	EncryptionKey string `help:"the root key for encrypting the data which will be stored in KeyFilePath" setup:"true"`
	KeyFilepath   string `help:"the path to the file which contains the root key for encrypting the data"`
	DataType      int    `help:"Type of encryption to use for content and metadata (1=AES-GCM, 2=SecretBox)" default:"1"`
	PathType      int    `help:"Type of encryption to use for paths (0=Unencrypted, 1=AES-GCM, 2=SecretBox)" default:"1"`
}

EncryptionConfig is a configuration struct that keeps details about encrypting segments

type RSConfig

type RSConfig struct {
	MaxBufferMem     memory.Size `help:"maximum buffer memory (in bytes) to be allocated for read buffers" default:"4MiB"`
	ErasureShareSize memory.Size `help:"the size of each new erasure share in bytes" default:"1KiB"`
	MinThreshold     int         `help:"the minimum pieces required to recover a segment. k." releaseDefault:"29" devDefault:"4"`
	RepairThreshold  int         `help:"the minimum safe pieces before a repair is triggered. m." releaseDefault:"35" devDefault:"6"`
	SuccessThreshold int         `help:"the desired total pieces for a segment. o." releaseDefault:"80" devDefault:"8"`
	MaxThreshold     int         `help:"the largest amount of pieces to encode to. n." releaseDefault:"130" devDefault:"10"`
}

RSConfig is a configuration struct that keeps details about default redundancy strategy information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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