Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
filetransfer.hh File Reference
#include <optional>
#include <cstdint>
#include <string>
#include <future>
#include "nix/util/logging.hh"
#include "nix/util/types.hh"
#include "nix/util/ref.hh"
#include "nix/util/configuration.hh"
#include "nix/util/serialise.hh"
#include "nix/util/url.hh"
#include "nix/store/config.hh"
#include "nix/store/s3-url.hh"

Go to the source code of this file.

Classes

class  nix::FileTransferSettings
struct  nix::UsernameAuth
struct  nix::FileTransferRequest
struct  nix::FileTransferRequest::UploadData
struct  nix::FileTransferResult
struct  nix::FileTransfer
class  nix::FileTransfer::Item
struct  nix::FileTransfer::ItemHandle
class  nix::FileTransferError

Enumerations

enum struct  nix::HttpMethod {
  Get , Put , Head , Post ,
  Delete
}
enum class  PauseTransfer : bool { No = false , Yes = true }

Functions

const std::filesystem::path & nix::nixConfDir ()
ref< FileTransfer > nix::getFileTransfer ()
ref< FileTransfer > nix::makeFileTransfer (const FileTransferSettings &settings)

Enumeration Type Documentation

◆ HttpMethod

enum struct nix::HttpMethod
strong

HTTP methods supported by FileTransfer.

Function Documentation

◆ getFileTransfer()

ref< FileTransfer > nix::getFileTransfer ( )
Returns
a shared FileTransfer object.

Using this object is preferred because it enables connection reuse and HTTP/2 multiplexing.

◆ makeFileTransfer()

ref< FileTransfer > nix::makeFileTransfer ( const FileTransferSettings & settings = fileTransferSettings)
Returns
a new FileTransfer object

Prefer getFileTransfer() to this; see its docs for why.

◆ nixConfDir()

const std::filesystem::path & nix::nixConfDir ( )

On Windows, NIX_CONF_DIR (and other directories like NIX_STATE_DIR, NIX_LOG_DIR) are not defined at compile time, so we determine paths at runtime using the Windows known folders API (FOLDERID_ProgramData). This allows Nix to work correctly regardless of which drive Windows is installed on.

The directory where system configuration files are stored.

This is needed very early during initialization, before a main Settings object can be constructed.