mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
rename some things in the sdk (#2809)
* rename some things in the sdk * fix docs * rename some types exported from rust
This commit is contained in:
@@ -11,12 +11,18 @@ use crate::net::acme::AcmeProvider;
|
||||
use crate::prelude::*;
|
||||
use crate::util::serde::{display_serializable, HandlerExtSerde};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all_fields = "camelCase")]
|
||||
#[serde(tag = "kind")]
|
||||
#[ts(export)]
|
||||
pub enum HostAddress {
|
||||
Onion {
|
||||
#[ts(type = "string")]
|
||||
address: OnionAddressV3,
|
||||
},
|
||||
Domain {
|
||||
#[ts(type = "string")]
|
||||
address: InternedString,
|
||||
public: bool,
|
||||
acme: Option<AcmeProvider>,
|
||||
|
||||
@@ -221,9 +221,10 @@ pub async fn list_bindings(
|
||||
.de()
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetPublicParams {
|
||||
#[ts(export)]
|
||||
pub struct BindingSetPublicParams {
|
||||
internal_port: u16,
|
||||
#[arg(long)]
|
||||
public: Option<bool>,
|
||||
@@ -231,10 +232,10 @@ pub struct SetPublicParams {
|
||||
|
||||
pub async fn set_public(
|
||||
ctx: RpcContext,
|
||||
SetPublicParams {
|
||||
BindingSetPublicParams {
|
||||
internal_port,
|
||||
public,
|
||||
}: SetPublicParams,
|
||||
}: BindingSetPublicParams,
|
||||
(package, host): (PackageId, HostId),
|
||||
) -> Result<(), Error> {
|
||||
ctx.db
|
||||
|
||||
@@ -114,7 +114,7 @@ async fn list_interfaces(
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
#[ts(export)]
|
||||
struct SetPublicParams {
|
||||
struct NetworkInterfaceSetPublicParams {
|
||||
#[ts(type = "string")]
|
||||
interface: InternedString,
|
||||
public: Option<bool>,
|
||||
@@ -122,7 +122,7 @@ struct SetPublicParams {
|
||||
|
||||
async fn set_public(
|
||||
ctx: RpcContext,
|
||||
SetPublicParams { interface, public }: SetPublicParams,
|
||||
NetworkInterfaceSetPublicParams { interface, public }: NetworkInterfaceSetPublicParams,
|
||||
) -> Result<(), Error> {
|
||||
ctx.net_controller
|
||||
.net_iface
|
||||
|
||||
Reference in New Issue
Block a user