⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

RepoServer

Struct RepoServer 

Source
pub struct RepoServer {
    pub config: RepoConfig,
    pub index: RepoIndex,
    /* private fields */
}
Expand description

Package repository server.

Manages the package index, handles uploads with optional signature verification, and provides search/listing capabilities.

Fields§

§config: RepoConfig§index: RepoIndex

Implementations§

Source§

impl RepoServer

Source

pub fn init() -> Self

Initialize a new repository server with default configuration.

Source

pub fn with_config(config: RepoConfig) -> Self

Initialize with custom configuration.

Source

pub fn add_package( &mut self, meta: RepoPackageMeta, data: Vec<u8>, signature: Option<&PackageSignature>, ) -> Result<(), KernelError>

Register a package in the index.

If require_signatures is enabled, the caller must provide a valid signature. The package data is stored in the internal map.

Source

pub fn remove_package( &mut self, name: &str, version: &str, ) -> Result<(), KernelError>

Remove a package (specific version) from the index and storage.

Source

pub fn search(&self, pattern: &str) -> Vec<&RepoPackageMeta>

Search packages by substring match on name.

Source

pub fn get_package_info( &self, name: &str, version: &str, ) -> Option<&RepoPackageMeta>

Get metadata for a specific package name and version.

Source

pub fn list_versions(&self, name: &str) -> Option<&Vec<RepoPackageMeta>>

List all versions for a given package name.

Source

pub fn list_packages( &self, offset: usize, page_size: usize, ) -> Vec<&RepoPackageMeta>

Paginated listing of all packages.

Returns at most page_size entries starting from offset.

Source

pub fn generate_index_json(&self) -> String

Generate a JSON-like index string for HTTP serving.

Source

pub fn verify_upload( &self, signature: &PackageSignature, archive_data: &[u8], ) -> bool

Verify an upload signature using Ed25519 marker check.

Source

pub fn handle_request(&self, req: &RepoRequest) -> RepoResponse

Route an HTTP request to the appropriate handler.

Source

pub fn get_package_data(&self, name: &str, version: &str) -> Option<&Vec<u8>>

Get the raw package data for download.

Source

pub fn total_storage_bytes(&self) -> u64

Total stored package data in bytes.

Auto Trait Implementations§

§

impl Freeze for RepoServer

§

impl RefUnwindSafe for RepoServer

§

impl Send for RepoServer

§

impl Sync for RepoServer

§

impl Unpin for RepoServer

§

impl UnwindSafe for RepoServer

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.