make service interfaces and hosts one to one

This commit is contained in:
Matt Hill
2024-02-19 12:40:52 -07:00
parent eae75c13bb
commit d7bc7a2d38
15 changed files with 222 additions and 311 deletions

View File

@@ -1,13 +1,13 @@
import { Address } from "../types"
import { Host, PortOptions } from "./Host"
import { AddressInfo } from "../types"
import { Host, BindOptions } from "./Host"
export class Origin<T extends Host> {
constructor(
readonly host: T,
readonly options: PortOptions,
readonly options: BindOptions,
) {}
build({ username, path, search }: BuildOptions): Address {
build({ username, path, search }: BuildOptions): AddressInfo {
const qpEntries = Object.entries(search)
.map(
([key, val]) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`,