Files
moon-i2p/encoding/pkg.generated.mbti
T
nandi dd5b132b5a
Rolling Release / Test (MoonBit, Extension, Scripts) (push) Successful in 21s
Rolling Release / Build & Publish Rolling Release (push) Successful in 2m20s
feat: persist I2P torrent list to EDN state file across restarts
- Save active and paused torrents to torrents.edn on add, remove, pause, resume, and metadata fetch, then restore them on router startup.
- Default path is $MOON_I2P_DATA_DIR, then $XDG_DATA_HOME, then ~/.local/share/moon-i2p-browser. Add --torrent-state <file> to override, or --no-torrent-state to disable.
- Write the state file atomically (temp file, fsync, rename). A corrupt or unsupported file logs a warning and does not block startup.
- Verify restored pieces incrementally in the background for large torrents; these show as state "checking" in /api/torrents.
- Expose state_file in /api/status and the startup banner.
- Add standard RFC 4648 Base64 encode/decode helpers, used for the info-b64 field.
- Add the moonedn dependency and pass --torrent-state from the Android service.
2026-11-29 02:46:23 -08:00

95 lines
2.6 KiB
Plaintext

// Generated using `moon info`, DON'T EDIT IT
package "experiments/moon_i2p/encoding"
import {
"moonbitlang/core/debug",
}
// Values
pub fn base32_decode(String) -> Bytes raise EncodingError
pub fn base32_encode(Bytes) -> String
pub fn base64_decode(String) -> Bytes raise EncodingError
pub fn base64_encode(Bytes) -> String
pub fn base64_std_decode(String) -> Bytes raise EncodingError
pub fn base64_std_encode(Bytes) -> String
pub fn crc32(Bytes) -> UInt32
pub fn deflate_raw(Bytes) -> Bytes
pub fn gzip_compress(Bytes) -> Bytes
pub fn gzip_decompress(Bytes) -> Bytes raise EncodingError
pub fn hex_decode(String) -> Bytes raise EncodingError
pub fn hex_encode(Bytes) -> String
pub fn i2cp_gzip_unwrap(Bytes) -> (I2cpGzipHeader, Bytes) raise EncodingError
pub fn i2cp_gzip_wrap(Bytes, from_port? : UInt32, to_port? : UInt32, protocol? : Byte) -> Bytes
pub fn inflate_raw(Bytes) -> Bytes raise EncodingError
pub fn string_to_utf8_bytes(String) -> Bytes
pub fn utf8_bytes_to_string(Bytes) -> String raise EncodingError
pub fn zip_extract_entries(Bytes) -> Array[(String, Bytes)] raise EncodingError
// Errors
#derive(Eq, @debug.Debug)
pub suberror EncodingError {
UnexpectedEof(String)
InvalidCharacter(String)
InvalidLength(String)
ValueOutOfRange(String)
}
// Types and methods
#derive(Eq, @debug.Debug)
pub(all) struct I2cpGzipHeader {
from_port : UInt32
to_port : UInt32
protocol : Byte
}
pub struct Reader {
data : Bytes
mut pos : Int32
}
pub fn Reader::is_eof(Self) -> Bool
pub fn Reader::new(Bytes) -> Self
pub fn Reader::position(Self) -> Int32
pub fn Reader::read_bytes(Self, Int32) -> Bytes raise EncodingError
pub fn Reader::read_i2p_string(Self) -> String raise EncodingError
pub fn Reader::read_remaining(Self) -> Bytes
pub fn Reader::read_u16_be(Self) -> UInt32 raise EncodingError
pub fn Reader::read_u32_be(Self) -> UInt32 raise EncodingError
pub fn Reader::read_u64_be(Self) -> UInt64 raise EncodingError
pub fn Reader::read_u8(Self) -> Byte raise EncodingError
pub fn Reader::remaining(Self) -> Int32
pub fn Reader::skip(Self, Int32) -> Unit raise EncodingError
pub struct Writer {
buf : Array[Byte]
}
pub fn Writer::length(Self) -> Int32
pub fn Writer::new(capacity? : Int32) -> Self
pub fn Writer::to_bytes(Self) -> Bytes
pub fn Writer::write_bytes(Self, Bytes) -> Unit
pub fn Writer::write_i2p_string(Self, String) -> Unit raise EncodingError
pub fn Writer::write_u16_be(Self, UInt32) -> Unit
pub fn Writer::write_u32_be(Self, UInt32) -> Unit
pub fn Writer::write_u64_be(Self, UInt64) -> Unit
pub fn Writer::write_u8(Self, Byte) -> Unit
// Type aliases
// Traits