pub struct Config {
pub api_key: String,
pub api_url: String,
pub sailbox_api_url: String,
pub imagebuilder_url: String,
pub sailbox_ingress_url: String,
pub sailbox_ingress_mode: String,
}Expand description
Resolved SDK configuration: credentials plus the three service endpoints.
Fields§
§api_key: StringBearer API key sent on every request (trimmed of surrounding whitespace).
api_url: StringBase URL of the public Sail REST API (no trailing path).
sailbox_api_url: StringBase URL of the sailbox lifecycle/exec API.
imagebuilder_url: Stringhost:port target of the imagebuilder dispatcher gRPC service.
sailbox_ingress_url: StringBase URL the platform edge serves listener ingress from.
sailbox_ingress_mode: StringHow listener URLs are addressed under the ingress base: "wildcard"
(per-listener subdomain, deployed) or "path" (one host, local stacks).
Implementations§
Source§impl Config
impl Config
Sourcepub fn resolve(
mode: Option<&str>,
api_key: String,
api_url: Option<String>,
sailbox_api_url: Option<String>,
imagebuilder_url: Option<String>,
sailbox_ingress_url: Option<String>,
) -> Result<Config, SailError>
pub fn resolve( mode: Option<&str>, api_key: String, api_url: Option<String>, sailbox_api_url: Option<String>, imagebuilder_url: Option<String>, sailbox_ingress_url: Option<String>, ) -> Result<Config, SailError>
Resolve a config from a mode plus explicit overrides. mode selects
the endpoint defaults (empty/None means prod); any non-empty override
wins over its default. The API key is required and trimmed.
Sourcepub fn from_env() -> Result<Config, SailError>
pub fn from_env() -> Result<Config, SailError>
Resolve a config from the environment, falling back to the stored
~/.sail credential and settings for any value the environment does not
set. Environment variables always win. The stored API key is applied only
when its tagged target matches the resolved one, so a key minted for one
environment is never sent to another. The key is trimmed so one sourced
with a trailing newline can’t produce a malformed bearer token.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request