bit_io_native

    Native HTTP, process, and worktree adapters for bit

    git
    io
    native
    Download zip
    Author
    Version
    0.47.0
    License
    Apache-2.0
    Last updated
    13 days ago
    Downloads
    1K

    #bit_io_native

    Native transport and filesystem adapters for bit.

    NativeHttpClient

    pub struct NativeHttpClient {
    dummy : Int
    }

    NativeHttpClient::new

    amz_date_now

    fn amz_date_now() -> String

    Current time as SigV4's YYYYMMDDTHHMMSSZ.

    A signed request is rejected when its timestamp drifts more than a few minutes from the server's, so this must be a real clock, not a counter.

    clone_http

    async fn clone_http(remote : String, prefer_v2 : Bool, depth? : Int, filter? :
    FilterSpec
    ) -> (Array[(
    ObjectId
    , String)], Array[
    PackObject
    ]) raise
    GitError

    clone_http_to_fs

    async fn clone_http_to_fs(remote : String, prefer_v2 : Bool, fs : &
    FileSystem
    , root : String, rfs : &
    RepoFileSystem
    , depth? : Int, filter? :
    FilterSpec
    , no_checkout? : Bool) -> Array[(
    ObjectId
    , String)] raise
    GitError

    Clone and checkout into filesystem under root.
    • depth > 0: shallow clone with that depth
    • filter: partial clone filter (e.g., FilterSpec::BlobNone)

    clone_process

    async fn clone_process(remote : String, prefer_v2 : Bool, depth? : Int, filter? :
    FilterSpec
    ) -> (Array[(
    ObjectId
    , String)], Array[
    PackObject
    ]) raise
    GitError

    clone_process_to_fs

    async fn clone_process_to_fs(remote : String, prefer_v2 : Bool, fs : &
    FileSystem
    , root : String, rfs : &
    RepoFileSystem
    , depth? : Int, filter? :
    FilterSpec
    , no_checkout? : Bool) -> Array[(
    ObjectId
    , String)] raise
    GitError

    Clone and checkout into filesystem under root.

    clone_remote

    async fn clone_remote(remote : String, prefer_v2 : Bool) -> (Array[(
    ObjectId
    , String)], Array[
    PackObject
    ]) raise
    GitError

    clone_remote_to_fs

    async fn clone_remote_to_fs(remote : String, prefer_v2 : Bool, fs : &
    FileSystem
    , root : String, rfs : &
    RepoFileSystem
    ) -> Array[(
    ObjectId
    , String)] raise
    GitError

    clone_to_fs_with_http

    async fn clone_to_fs_with_http(remote : String, prefer_v2 : Bool, depth : Int, filter :
    FilterSpec
    , fs : &
    FileSystem
    , root : String, http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , rfs : &
    RepoFileSystem
    , no_checkout? : Bool) -> Array[(
    ObjectId
    , String)] raise
    GitError

    clone_with_http

    async fn clone_with_http(remote : String, prefer_v2 : Bool, depth : Int, filter :
    FilterSpec
    , http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    ) -> (Array[(
    ObjectId
    , String)], Array[
    PackObject
    ]) raise
    GitError

    discover_receive_refs_http

    Fetch receive-pack refs via smart HTTP (native)

    discover_refs

    Discover refs and capabilities from remote (native)

    discover_upload_refs

    async fn discover_upload_refs(remote : String, prefer_v2 : Bool) -> (Array[(
    ObjectId
    , String)], Array[String],
    ProtocolVersion
    , Map[String, String]) raise
    GitError

    discover_upload_refs_http

    async fn discover_upload_refs_http(remote : String, prefer_v2 : Bool) -> (Array[(
    ObjectId
    , String)], Array[String],
    ProtocolVersion
    , Map[String, String]) raise
    GitError

    discover_upload_refs_process

    async fn discover_upload_refs_process(remote : String, prefer_v2 : Bool) -> (Array[(
    ObjectId
    , String)], Array[String],
    ProtocolVersion
    , Map[String, String]) raise
    GitError

    discover_upload_refs_with_http

    async fn discover_upload_refs_with_http(remote : String, prefer_v2 : Bool, http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    ) -> (Array[(
    ObjectId
    , String)], Array[String],
    ProtocolVersion
    , Map[String, String]) raise
    GitError

    fetch_objects_process

    fetch_objects_with_http

    async fn fetch_objects_with_http(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, depth : Int, filter :
    FilterSpec
    , http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) -> Array[
    PackObject
    ] raise
    GitError

    fetch_pack

    async fn fetch_pack(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) -> Bytes raise
    GitError

    fetch_pack_http

    async fn fetch_pack_http(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, depth? : Int, filter? :
    FilterSpec
    , haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) -> Bytes raise
    GitError

    fetch_pack_process

    async fn fetch_pack_process(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, depth? : Int, filter? :
    FilterSpec
    , haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) -> Bytes raise
    GitError

    fetch_pack_process_result

    fetch_pack_with_http

    async fn fetch_pack_with_http(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, depth : Int, filter :
    FilterSpec
    , http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) -> Bytes raise
    GitError

    fetch_pack_with_http_result

    async fn fetch_pack_with_http_result(remote : String, wants : Array[
    ObjectId
    ], prefer_v2 : Bool, depth : Int, filter :
    FilterSpec
    , http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    , haves? : Array[
    ObjectId
    ], shallow? : Array[
    ObjectId
    ]) ->
    FetchPackResult
    raise
    GitError

    init_env_provider

    fn init_env_provider() -> Unit

    init_native_io

    fn init_native_io() -> Unit

    init_worktree_probe

    fn init_worktree_probe() -> Unit

    native_http_delete

    async fn native_http_delete(url : String, headers : Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError

    DELETE, needed by object-store garbage collection.

    @http exposes no delete_stream, so the request is issued through a Client directly: the constructor takes an origin, the request line takes the path.

    native_http_get

    async fn native_http_get(url : String, headers : Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError

    native_http_post

    async fn native_http_post(url : String, body : Bytes, headers : Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError

    native_http_put

    async fn native_http_put(url : String, body : Bytes, headers : Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError

    native_objstore_send

    async fn native_objstore_send(verb : String, url : String, headers : Map[String, String], body : Bytes) ->
    HttpReply
    raise
    GitError

    Native transport for bit_objstore.

    This is the only place the object store touches the network: the store itself takes this as an injected function, which is what lets its status-code handling be tested without a bucket and lets the same store run under a different transport elsewhere.

    Bodies are read strictly — a truncated pack that reported success would corrupt the repository it was read for.

    native_readdir_typed

    fn native_readdir_typed(path : String) -> Array[(String, Int)]?

    Read directory entries with d_type info via native readdir. Returns array of (name, d_type) pairs where d_type: 4=DT_DIR, 8=DT_REG, 10=DT_LNK, 0=DT_UNKNOWN.

    native_s3_store

    fn native_s3_store(config :
    S3Config
    , page_size? : Int) ->
    S3Store

    Build an S3-backed store wired to the native transport and clock.

    push

    Push a packfile to remote repository (native)

    push_file

    async fn push_file(remote :
    Remote
    , content : Bytes, filename : String, message : String, author : String, timestamp : Int64, parent :
    ObjectId
    ?) ->
    ObjectId
    raise
    GitError

    Push a single file as a new commit (native)

    upload_pack_info_refs

    async fn upload_pack_info_refs(remote : String, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_info_refs_http

    async fn upload_pack_info_refs_http(remote : String, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_info_refs_process

    async fn upload_pack_info_refs_process(remote : String, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_info_refs_with_http

    async fn upload_pack_info_refs_with_http(remote : String, prefer_v2 : Bool, http_get : async (String, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    ) -> Bytes raise
    GitError

    upload_pack_request

    async fn upload_pack_request(remote : String, body : Bytes, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_request_http

    async fn upload_pack_request_http(remote : String, body : Bytes, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_request_process

    async fn upload_pack_request_process(remote : String, body : Bytes, prefer_v2 : Bool) -> Bytes raise
    GitError

    upload_pack_request_with_http

    async fn upload_pack_request_with_http(remote : String, body : Bytes, prefer_v2 : Bool, http_post : async (String, Bytes, Map[String, String]) -> (
    HttpResponse
    , Bytes) raise
    GitError
    ) -> Bytes raise
    GitError