// Common types used across ArcBox protocols.
//
// This file defines shared message types that are used by multiple services.
//
// Design sources:
// - internal-docs/architecture/cli-api.md (ArcBox internal design)
// - Docker Engine API v1.43 (https://docs.docker.com/engine/api/v1.43/)
// - containerd ttrpc protocol design patterns

syntax = "proto3";

package arcbox.common;

// Empty message for requests/responses that don't need data.
message Empty {}

// Timestamp with nanosecond precision.
message Timestamp {
    // Seconds since Unix epoch.
    int64 seconds = 1;
    // Nanoseconds within the second.
    int32 nanos = 2;
}

// Key-value pair for labels, environment variables, etc.
message KeyValue {
    string key = 1;
    string value = 2;
}

// Mount specification for bind mounts and volumes.
message Mount {
    // Source path on host.
    string source = 1;
    // Target path in container.
    string target = 2;
    // Mount type: bind, volume, tmpfs.
    string type = 3;
    // Read-only flag.
    bool readonly = 4;
}

// Port binding specification.
message PortBinding {
    // Port inside the container.
    uint32 container_port = 1;
    // Port on the host.
    uint32 host_port = 2;
    // Protocol: tcp, udp.
    string protocol = 3;
    // Host IP to bind to.
    string host_ip = 4;
}

// Resource limits for containers.
message ResourceLimits {
    // Memory limit in bytes.
    uint64 memory_bytes = 1;
    // CPU shares (relative weight).
    uint64 cpu_shares = 2;
    // CPU quota in microseconds per period.
    int64 cpu_quota = 3;
    // CPU period in microseconds.
    uint64 cpu_period = 4;
    // Number of CPUs.
    double cpus = 5;
    // Memory swap limit in bytes.
    int64 memory_swap = 6;
}
