Documentation ¶
Index ¶
- func NewSatellite(ac autopilotClient, bc busClient, wc workerClient, dir string, ...) (http.Handler, error)
- func UploadObject(r io.Reader, bucket, path, mimeType string) error
- func UploadPart(r io.Reader, id string, part int) error
- type BucketFiles
- type Client
- func (c *Client) AbortMultipart(ctx context.Context, id string) error
- func (c *Client) AddObject(bucket, path string, parts []uint64) error
- func (c *Client) AddSatellite(si SatelliteInfo) error
- func (c *Client) CompleteMultipart(ctx context.Context, id string) error
- func (c *Client) Config() (cfg Config, err error)
- func (c *Client) CreateMultipart(ctx context.Context, key object.EncryptionKey, bucket, path, mimeType string) (string, error)
- func (c *Client) DeleteObject(bucket, path string) error
- func (c *Client) DeleteObjects(bucket, path string) error
- func (c *Client) FormContract(ctx context.Context, hpk types.PublicKey, endHeight uint64, storage uint64, ...) (api.ContractMetadata, error)
- func (c *Client) FormContracts(ctx context.Context, hosts uint64, period uint64, renewWindow uint64, ...) ([]api.ContractMetadata, error)
- func (c *Client) GetObject(bucket, path string) (or ObjectResponse, err error)
- func (c *Client) GetSatellite(pk types.PublicKey) (si SatelliteInfo, err error)
- func (c *Client) GetSatellites() (satellites map[types.PublicKey]SatelliteInfo, err error)
- func (c *Client) GetSettings(ctx context.Context) (settings RenterSettings, err error)
- func (c *Client) RenewContract(ctx context.Context, fcid types.FileContractID, endHeight uint64, ...) (api.ContractMetadata, error)
- func (c *Client) RenewContracts(ctx context.Context, contracts []types.FileContractID, period uint64, ...) ([]api.ContractMetadata, error)
- func (c *Client) RequestContracts(ctx context.Context) ([]api.ContractMetadata, error)
- func (c *Client) RequestMetadata(ctx context.Context, set string) (objects []object.Object, err error)
- func (c *Client) RequestSlabs(ctx context.Context, set string) (slabs []object.Slab, err error)
- func (c *Client) SaveMetadata(ctx context.Context, fm FileMetadata, isNew bool) error
- func (c *Client) SetConfig(cfg Config) error
- func (c *Client) ShareContracts(ctx context.Context) error
- func (c *Client) UpdateRevision(ctx context.Context, rev rhpv2.ContractRevision, spending api.ContractSpending) error
- func (c *Client) UpdateSettings(ctx context.Context, settings RenterSettings) error
- func (c *Client) UpdateSlab(ctx context.Context, s object.Slab, packed bool) error
- type Config
- type CreateMultipartRequest
- type CreateMultipartResponse
- type FileMetadata
- type FormContractRequest
- type FormRequest
- type ObjectPutRequest
- type ObjectResponse
- type RenewContractRequest
- type RenewRequest
- type RenterSettings
- type Satellite
- type SatelliteInfo
- type SatellitesAllResponse
- type SaveMetadataRequest
- type UpdateRevisionRequest
- type UpdateSlabRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSatellite ¶
func NewSatellite(ac autopilotClient, bc busClient, wc workerClient, dir string, seed types.PrivateKey, l *zap.Logger, satAddr string, satPassword string) (http.Handler, error)
NewSatellite returns a new Satellite handler.
func UploadObject ¶ added in v0.4.0
UploadObject uploads a file to the satellite.
Types ¶
type BucketFiles ¶ added in v0.3.0
BucketFiles contains a list of filepaths within a single bucket.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides methods for interacting with an API server.
var StaticSatellite *Client
func NewClient ¶
NewClient returns a client that communicates with a renterd satellite server listening on the specified address.
func (*Client) AbortMultipart ¶ added in v0.6.0
AbortMultipart deletes an incomplete multipart upload on the satellite.
func (*Client) AddObject ¶ added in v0.6.0
AddObject adds the information about an encrypted object.
func (*Client) AddSatellite ¶
func (c *Client) AddSatellite(si SatelliteInfo) error
AddSatellite adds a satellite to the store.
func (*Client) CompleteMultipart ¶ added in v0.6.0
CompleteMultipart completes an incomplete multipart upload on the satellite.
func (*Client) CreateMultipart ¶ added in v0.6.0
func (c *Client) CreateMultipart(ctx context.Context, key object.EncryptionKey, bucket, path, mimeType string) (string, error)
CreateMultipart registers a new multipart upload with the satellite and returns the upload ID.
func (*Client) DeleteObject ¶ added in v0.6.0
DeleteObject deletes the information about an encrypted object.
func (*Client) DeleteObjects ¶ added in v0.6.0
DeleteObjects deletes the information about a series of encrypted objects.
func (*Client) FormContract ¶ added in v0.1.2
func (c *Client) FormContract(ctx context.Context, hpk types.PublicKey, endHeight uint64, storage uint64, upload uint64, download uint64) (api.ContractMetadata, error)
FormContract requests the satellite to form a contract with the specified host and adds it to the contract set.
func (*Client) FormContracts ¶
func (c *Client) FormContracts(ctx context.Context, hosts uint64, period uint64, renewWindow uint64, storage uint64, upload uint64, download uint64) ([]api.ContractMetadata, error)
FormContracts requests the satellite to form the specified number of contracts with the hosts and adds them to the contract set.
func (*Client) GetObject ¶ added in v0.6.0
func (c *Client) GetObject(bucket, path string) (or ObjectResponse, err error)
GetObject retrieves the information about an encrypted object.
func (*Client) GetSatellite ¶
func (c *Client) GetSatellite(pk types.PublicKey) (si SatelliteInfo, err error)
GetSatellite retrieves the satellite information.
func (*Client) GetSatellites ¶
func (c *Client) GetSatellites() (satellites map[types.PublicKey]SatelliteInfo, err error)
GetSatellites returns all known satellites.
func (*Client) GetSettings ¶ added in v0.1.4
func (c *Client) GetSettings(ctx context.Context) (settings RenterSettings, err error)
GetSettings retrieves the renter's opt-in settings.
func (*Client) RenewContract ¶ added in v0.1.3
func (c *Client) RenewContract(ctx context.Context, fcid types.FileContractID, endHeight uint64, storage uint64, upload uint64, download uint64) (api.ContractMetadata, error)
RenewContract requests the satellite to renew the specified contract and adds the new contract to the contract set.
func (*Client) RenewContracts ¶
func (c *Client) RenewContracts(ctx context.Context, contracts []types.FileContractID, period uint64, renewWindow uint64, storage uint64, upload uint64, download uint64) ([]api.ContractMetadata, error)
RenewContracts requests the satellite to renew the given set of contracts and add them to the contract set.
func (*Client) RequestContracts ¶
RequestContracts requests the existing active contracts from the satellite and adds them to the contract set.
func (*Client) RequestMetadata ¶ added in v0.1.9
func (c *Client) RequestMetadata(ctx context.Context, set string) (objects []object.Object, err error)
RequestMetadata requests the file metadata from the satellite.
func (*Client) RequestSlabs ¶ added in v0.4.0
RequestSlabs requests any modified slabs from the satellite.
func (*Client) SaveMetadata ¶ added in v0.1.9
SaveMetadata sends the file metadata to the satellite.
func (*Client) ShareContracts ¶ added in v0.1.11
ShareContracts sends the contract set to the satellite.
func (*Client) UpdateRevision ¶
func (c *Client) UpdateRevision(ctx context.Context, rev rhpv2.ContractRevision, spending api.ContractSpending) error
UpdateRevision submits an updated contract revision to the satellite.
func (*Client) UpdateSettings ¶ added in v0.1.4
func (c *Client) UpdateSettings(ctx context.Context, settings RenterSettings) error
UpdateSettings updates the renter's opt-in settings.
type Config ¶
type Config struct { Enabled bool `json:"enabled"` Encrypt bool `json:"encrypt"` EncryptionKey object.EncryptionKey `json:"encryptionKey"` SatelliteInfo }
Config contains the satellite configuration parameters.
type CreateMultipartRequest ¶ added in v0.6.0
type CreateMultipartRequest struct { Key object.EncryptionKey `json:"key"` Bucket string `json:"bucket"` Path string `json:"path"` MimeType string `json:"mime"` }
CreateMultipartRequest is the request type for the CreateMultipart RPC.
type CreateMultipartResponse ¶ added in v0.6.0
type CreateMultipartResponse struct {
UploadID string `json:"uploadID"`
}
CreateMultipartResponse is the response type for the CreateMultipart RPC.
type FileMetadata ¶ added in v0.1.9
type FileMetadata struct { Key object.EncryptionKey `json:"key"` Bucket string `json:"bucket"` Path string `json:"path"` ETag string `json:"etag"` MimeType string `json:"mime"` Parts []uint64 `json:"parts"` Slabs []object.SlabSlice `json:"slabs"` Data []byte `json:"data"` }
FileMetadata contains the uploaded file metadata.
type FormContractRequest ¶ added in v0.1.2
type FormContractRequest struct { HostKey types.PublicKey `json:"hostPublicKey"` // Contract configuration (all units are blocks or bytes). EndHeight uint64 `json:"endHeight"` Download uint64 `json:"download"` Upload uint64 `json:"upload"` Storage uint64 `json:"storage"` }
FormContractRequest is the request type for the FormContract RPC.
type FormRequest ¶
type FormRequest struct { Hosts uint64 `json:"hosts"` // Contract configuration (all units are blocks or bytes). Period uint64 `json:"period"` RenewWindow uint64 `json:"renewWindow"` Download uint64 `json:"download"` Upload uint64 `json:"upload"` Storage uint64 `json:"storage"` }
FormRequest is the request type for the FormContracts RPC.
type ObjectPutRequest ¶ added in v0.6.0
ObjectPutRequest is the request type for the PUT /object requests.
type ObjectResponse ¶ added in v0.6.0
ObjectResponse is the response type for the GET /object request.
type RenewContractRequest ¶ added in v0.1.3
type RenewContractRequest struct { Contract types.FileContractID `json:"contract"` // Contract configuration (all units are blocks or bytes). EndHeight uint64 `json:"endHeight"` Download uint64 `json:"download"` Upload uint64 `json:"upload"` Storage uint64 `json:"storage"` }
RenewContractRequest is the request type for the RenewContract RPC.
type RenewRequest ¶
type RenewRequest struct { Contracts []types.FileContractID `json:"contracts"` // Contract configuration (all units are blocks or bytes). Period uint64 `json:"period"` RenewWindow uint64 `json:"renewWindow"` Download uint64 `json:"download"` Upload uint64 `json:"upload"` Storage uint64 `json:"storage"` }
RenewRequest is the request type for the RenewContracts RPC.
type RenterSettings ¶ added in v0.1.4
type RenterSettings struct { AutoRenewContracts bool `json:"autoRenew"` BackupFileMetadata bool `json:"backupMetadata"` AutoRepairFiles bool `json:"autoRepair"` ProxyUploads bool `json:"proxyUploads"` }
RenterSettings contains the renter's opt-in settings.
func (*RenterSettings) DecodeFrom ¶ added in v0.1.4
func (settings *RenterSettings) DecodeFrom(d *types.Decoder)
DecodeFrom implements types.ProtocolObject.
func (*RenterSettings) EncodeTo ¶ added in v0.1.4
func (settings *RenterSettings) EncodeTo(e *types.Encoder)
EncodeTo implements types.ProtocolObject.
type Satellite ¶
type Satellite struct {
// contains filtered or unexported fields
}
Satellite is the interface between the renting software and the Sia Satellite node.
type SatelliteInfo ¶
type SatelliteInfo struct { Address string `json:"address"` MuxPort string `json:"muxPort"` PublicKey types.PublicKey `json:"publicKey"` RenterSeed []byte `json:"renterSeed"` }
SatelliteInfo contains the information about the satellite.
type SatellitesAllResponse ¶
type SatellitesAllResponse struct {
Satellites map[types.PublicKey]SatelliteInfo `json:"satellites"`
}
SatellitesAllResponse is the response type for the /satellites request.
type SaveMetadataRequest ¶ added in v0.1.9
type SaveMetadataRequest struct { Metadata FileMetadata `json:"metadata"` New bool `json:"new"` }
SaveMetadataRequest is the request type for the SaveMetadata RPC.
type UpdateRevisionRequest ¶
type UpdateRevisionRequest struct { Revision rhpv2.ContractRevision `json:"revision"` Spending api.ContractSpending `json:"spending"` }
UpdateRevisionRequest is the request type for the UpdateRevision RPC.
type UpdateSlabRequest ¶ added in v0.1.10
UpdateSlabRequest is the request type for the UpdateSlab RPC.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package chacha20 implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01.
|
Package chacha20 implements the ChaCha20 and XChaCha20 encryption algorithms as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01. |