diff --git a/api/swagger.yaml b/api/swagger.yaml index a3368b4..b0310d9 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1,1177 +1,1248 @@ basePath: / consumes: -- application/json + - application/json definitions: - APIConfig: - properties: - accesslog: - type: boolean - x-go-name: AccessLog - addr: - type: string - x-go-name: Addr - auth: - $ref: '#/definitions/AuthConfig' - auther: - type: string - x-go-name: Auther - pathPrefix: - type: string - x-go-name: PathPrefix - type: object - x-go-package: github.com/go-gost/x/config - AdmissionConfig: - properties: - file: - $ref: '#/definitions/FileLoader' - matchers: - items: - type: string - type: array - x-go-name: Matchers - name: - type: string - x-go-name: Name - redis: - $ref: '#/definitions/RedisLoader' - reload: - $ref: '#/definitions/Duration' - reverse: - type: boolean - x-go-name: Reverse - type: object - x-go-package: github.com/go-gost/x/config - AuthConfig: - properties: - password: - type: string - x-go-name: Password - username: - type: string - x-go-name: Username - type: object - x-go-package: github.com/go-gost/x/config - AutherConfig: - properties: - auths: - items: - $ref: '#/definitions/AuthConfig' - type: array - x-go-name: Auths - file: - $ref: '#/definitions/FileLoader' - name: - type: string - x-go-name: Name - redis: - $ref: '#/definitions/RedisLoader' - reload: - $ref: '#/definitions/Duration' - type: object - x-go-package: github.com/go-gost/x/config - BypassConfig: - properties: - file: - $ref: '#/definitions/FileLoader' - matchers: - items: - type: string - type: array - x-go-name: Matchers - name: - type: string - x-go-name: Name - redis: - $ref: '#/definitions/RedisLoader' - reload: - $ref: '#/definitions/Duration' - reverse: - type: boolean - x-go-name: Reverse - type: object - x-go-package: github.com/go-gost/x/config - ChainConfig: - properties: - hops: - items: - $ref: '#/definitions/HopConfig' - type: array - x-go-name: Hops - name: - type: string - x-go-name: Name - selector: - $ref: '#/definitions/SelectorConfig' - type: object - x-go-package: github.com/go-gost/x/config - Config: - properties: - admissions: - items: - $ref: '#/definitions/AdmissionConfig' - type: array - x-go-name: Admissions - api: - $ref: '#/definitions/APIConfig' - authers: - items: - $ref: '#/definitions/AutherConfig' - type: array - x-go-name: Authers - bypasses: - items: - $ref: '#/definitions/BypassConfig' - type: array - x-go-name: Bypasses - chains: - items: - $ref: '#/definitions/ChainConfig' - type: array - x-go-name: Chains - hosts: - items: - $ref: '#/definitions/HostsConfig' - type: array - x-go-name: Hosts - log: - $ref: '#/definitions/LogConfig' - metrics: - $ref: '#/definitions/MetricsConfig' - profiling: - $ref: '#/definitions/ProfilingConfig' - recorders: - items: - $ref: '#/definitions/RecorderConfig' - type: array - x-go-name: Recorders - resolvers: - items: - $ref: '#/definitions/ResolverConfig' - type: array - x-go-name: Resolvers - services: - items: - $ref: '#/definitions/ServiceConfig' - type: array - x-go-name: Services - tls: - $ref: '#/definitions/TLSConfig' - type: object - x-go-package: github.com/go-gost/x/config - ConnectorConfig: - properties: - auth: - $ref: '#/definitions/AuthConfig' - metadata: - additionalProperties: - type: object + APIConfig: + properties: + accesslog: + type: boolean + x-go-name: AccessLog + addr: + type: string + x-go-name: Addr + auth: + $ref: '#/definitions/AuthConfig' + auther: + type: string + x-go-name: Auther + pathPrefix: + type: string + x-go-name: PathPrefix type: object - x-go-name: Metadata - tls: - $ref: '#/definitions/TLSConfig' - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - DialerConfig: - properties: - auth: - $ref: '#/definitions/AuthConfig' - metadata: - additionalProperties: - type: object + x-go-package: github.com/go-gost/x/config + AdmissionConfig: + properties: + file: + $ref: '#/definitions/FileLoader' + matchers: + items: + type: string + type: array + x-go-name: Matchers + name: + type: string + x-go-name: Name + redis: + $ref: '#/definitions/RedisLoader' + reload: + $ref: '#/definitions/Duration' + reverse: + description: DEPRECATED by whitelist since beta.4 + type: boolean + x-go-name: Reverse + whitelist: + type: boolean + x-go-name: Whitelist type: object - x-go-name: Metadata - tls: - $ref: '#/definitions/TLSConfig' - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - Duration: - description: |- - A Duration represents the elapsed time between two instants - as an int64 nanosecond count. The representation limits the - largest representable duration to approximately 290 years. - format: int64 - type: integer - x-go-package: time - FileLoader: - properties: - path: - type: string - x-go-name: Path - type: object - x-go-package: github.com/go-gost/x/config - FileRecorder: - properties: - path: - type: string - x-go-name: Path - sep: - type: string - x-go-name: Sep - type: object - x-go-package: github.com/go-gost/x/config - ForwarderConfig: - properties: - selector: - $ref: '#/definitions/SelectorConfig' - targets: - items: - type: string - type: array - x-go-name: Targets - type: object - x-go-package: github.com/go-gost/x/config - HandlerConfig: - properties: - auth: - $ref: '#/definitions/AuthConfig' - auther: - type: string - x-go-name: Auther - chain: - type: string - x-go-name: Chain - metadata: - additionalProperties: - type: object + x-go-package: github.com/go-gost/x/config + AuthConfig: + properties: + password: + type: string + x-go-name: Password + username: + type: string + x-go-name: Username type: object - x-go-name: Metadata - retries: - format: int64 - type: integer - x-go-name: Retries - tls: - $ref: '#/definitions/TLSConfig' - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - HopConfig: - properties: - bypass: - type: string - x-go-name: Bypass - hosts: - type: string - x-go-name: Hosts - interface: - type: string - x-go-name: Interface - name: - type: string - x-go-name: Name - nodes: - items: - $ref: '#/definitions/NodeConfig' - type: array - x-go-name: Nodes - resolver: - type: string - x-go-name: Resolver - selector: - $ref: '#/definitions/SelectorConfig' - sockopts: - $ref: '#/definitions/SockOptsConfig' - type: object - x-go-package: github.com/go-gost/x/config - HostMappingConfig: - properties: - aliases: - items: - type: string - type: array - x-go-name: Aliases - hostname: - type: string - x-go-name: Hostname - ip: - type: string - x-go-name: IP - type: object - x-go-package: github.com/go-gost/x/config - HostsConfig: - properties: - file: - $ref: '#/definitions/FileLoader' - mappings: - items: - $ref: '#/definitions/HostMappingConfig' - type: array - x-go-name: Mappings - name: - type: string - x-go-name: Name - redis: - $ref: '#/definitions/RedisLoader' - reload: - $ref: '#/definitions/Duration' - type: object - x-go-package: github.com/go-gost/x/config - ListenerConfig: - properties: - auth: - $ref: '#/definitions/AuthConfig' - auther: - type: string - x-go-name: Auther - chain: - type: string - x-go-name: Chain - metadata: - additionalProperties: - type: object + x-go-package: github.com/go-gost/x/config + AutherConfig: + properties: + auths: + items: + $ref: '#/definitions/AuthConfig' + type: array + x-go-name: Auths + file: + $ref: '#/definitions/FileLoader' + name: + type: string + x-go-name: Name + redis: + $ref: '#/definitions/RedisLoader' + reload: + $ref: '#/definitions/Duration' type: object - x-go-name: Metadata - tls: - $ref: '#/definitions/TLSConfig' - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - LogConfig: - properties: - format: - type: string - x-go-name: Format - level: - type: string - x-go-name: Level - output: - type: string - x-go-name: Output - type: object - x-go-package: github.com/go-gost/x/config - MetricsConfig: - properties: - addr: - type: string - x-go-name: Addr - path: - type: string - x-go-name: Path - type: object - x-go-package: github.com/go-gost/x/config - NameserverConfig: - properties: - addr: - type: string - x-go-name: Addr - chain: - type: string - x-go-name: Chain - clientIP: - type: string - x-go-name: ClientIP - hostname: - type: string - x-go-name: Hostname - prefer: - type: string - x-go-name: Prefer - timeout: - $ref: '#/definitions/Duration' - ttl: - $ref: '#/definitions/Duration' - type: object - x-go-package: github.com/go-gost/x/config - NodeConfig: - properties: - addr: - type: string - x-go-name: Addr - bypass: - type: string - x-go-name: Bypass - connector: - $ref: '#/definitions/ConnectorConfig' - dialer: - $ref: '#/definitions/DialerConfig' - hosts: - type: string - x-go-name: Hosts - interface: - type: string - x-go-name: Interface - name: - type: string - x-go-name: Name - resolver: - type: string - x-go-name: Resolver - sockopts: - $ref: '#/definitions/SockOptsConfig' - type: object - x-go-package: github.com/go-gost/x/config - ProfilingConfig: - properties: - addr: - type: string - x-go-name: Addr - type: object - x-go-package: github.com/go-gost/x/config - RecorderConfig: - properties: - file: - $ref: '#/definitions/FileRecorder' - name: - type: string - x-go-name: Name - redis: - $ref: '#/definitions/RedisRecorder' - type: object - x-go-package: github.com/go-gost/x/config - RecorderObject: - properties: - name: - type: string - x-go-name: Name - record: - type: string - x-go-name: Record - type: object - x-go-package: github.com/go-gost/x/config - RedisLoader: - properties: - addr: - type: string - x-go-name: Addr - db: + x-go-package: github.com/go-gost/x/config + BypassConfig: + properties: + file: + $ref: '#/definitions/FileLoader' + matchers: + items: + type: string + type: array + x-go-name: Matchers + name: + type: string + x-go-name: Name + redis: + $ref: '#/definitions/RedisLoader' + reload: + $ref: '#/definitions/Duration' + reverse: + description: DEPRECATED by whitelist since beta.4 + type: boolean + x-go-name: Reverse + whitelist: + type: boolean + x-go-name: Whitelist + type: object + x-go-package: github.com/go-gost/x/config + ChainConfig: + properties: + hops: + items: + $ref: '#/definitions/HopConfig' + type: array + x-go-name: Hops + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + name: + type: string + x-go-name: Name + selector: + $ref: '#/definitions/SelectorConfig' + type: object + x-go-package: github.com/go-gost/x/config + ChainGroupConfig: + properties: + chains: + items: + type: string + type: array + x-go-name: Chains + selector: + $ref: '#/definitions/SelectorConfig' + type: object + x-go-package: github.com/go-gost/x/config + Config: + properties: + admissions: + items: + $ref: '#/definitions/AdmissionConfig' + type: array + x-go-name: Admissions + api: + $ref: '#/definitions/APIConfig' + authers: + items: + $ref: '#/definitions/AutherConfig' + type: array + x-go-name: Authers + bypasses: + items: + $ref: '#/definitions/BypassConfig' + type: array + x-go-name: Bypasses + chains: + items: + $ref: '#/definitions/ChainConfig' + type: array + x-go-name: Chains + hosts: + items: + $ref: '#/definitions/HostsConfig' + type: array + x-go-name: Hosts + log: + $ref: '#/definitions/LogConfig' + metrics: + $ref: '#/definitions/MetricsConfig' + profiling: + $ref: '#/definitions/ProfilingConfig' + recorders: + items: + $ref: '#/definitions/RecorderConfig' + type: array + x-go-name: Recorders + resolvers: + items: + $ref: '#/definitions/ResolverConfig' + type: array + x-go-name: Resolvers + services: + items: + $ref: '#/definitions/ServiceConfig' + type: array + x-go-name: Services + tls: + $ref: '#/definitions/TLSConfig' + type: object + x-go-package: github.com/go-gost/x/config + ConnectorConfig: + properties: + auth: + $ref: '#/definitions/AuthConfig' + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + tls: + $ref: '#/definitions/TLSConfig' + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + DialerConfig: + properties: + auth: + $ref: '#/definitions/AuthConfig' + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + tls: + $ref: '#/definitions/TLSConfig' + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + Duration: + description: |- + A Duration represents the elapsed time between two instants + as an int64 nanosecond count. The representation limits the + largest representable duration to approximately 290 years. format: int64 type: integer - x-go-name: DB - key: - type: string - x-go-name: Key - password: - type: string - x-go-name: Password - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - RedisRecorder: - properties: - addr: - type: string - x-go-name: Addr - db: - format: int64 - type: integer - x-go-name: DB - key: - type: string - x-go-name: Key - password: - type: string - x-go-name: Password - type: - type: string - x-go-name: Type - type: object - x-go-package: github.com/go-gost/x/config - ResolverConfig: - properties: - name: - type: string - x-go-name: Name - nameservers: - items: - $ref: '#/definitions/NameserverConfig' - type: array - x-go-name: Nameservers - type: object - x-go-package: github.com/go-gost/x/config - Response: - properties: - code: - format: int64 - type: integer - x-go-name: Code - msg: - type: string - x-go-name: Msg - type: object - x-go-package: github.com/go-gost/x/api - SelectorConfig: - properties: - failTimeout: - $ref: '#/definitions/Duration' - maxFails: - format: int64 - type: integer - x-go-name: MaxFails - strategy: - type: string - x-go-name: Strategy - type: object - x-go-package: github.com/go-gost/x/config - ServiceConfig: - properties: - addr: - type: string - x-go-name: Addr - admission: - type: string - x-go-name: Admission - bypass: - type: string - x-go-name: Bypass - forwarder: - $ref: '#/definitions/ForwarderConfig' - handler: - $ref: '#/definitions/HandlerConfig' - hosts: - type: string - x-go-name: Hosts - interface: - type: string - x-go-name: Interface - listener: - $ref: '#/definitions/ListenerConfig' - name: - type: string - x-go-name: Name - recorders: - items: - $ref: '#/definitions/RecorderObject' - type: array - x-go-name: Recorders - resolver: - type: string - x-go-name: Resolver - sockopts: - $ref: '#/definitions/SockOptsConfig' - type: object - x-go-package: github.com/go-gost/x/config - SockOptsConfig: - properties: - mark: - format: int64 - type: integer - x-go-name: Mark - type: object - x-go-package: github.com/go-gost/x/config - TLSConfig: - properties: - caFile: - type: string - x-go-name: CAFile - certFile: - type: string - x-go-name: CertFile - keyFile: - type: string - x-go-name: KeyFile - secure: - type: boolean - x-go-name: Secure - serverName: - type: string - x-go-name: ServerName - type: object - x-go-package: github.com/go-gost/x/config + x-go-package: time + FileLoader: + properties: + path: + type: string + x-go-name: Path + type: object + x-go-package: github.com/go-gost/x/config + FileRecorder: + properties: + path: + type: string + x-go-name: Path + sep: + type: string + x-go-name: Sep + type: object + x-go-package: github.com/go-gost/x/config + ForwarderConfig: + properties: + nodes: + items: + $ref: '#/definitions/NodeConfig' + type: array + x-go-name: Nodes + selector: + $ref: '#/definitions/SelectorConfig' + targets: + description: DEPRECATED by nodes since beta.4 + items: + type: string + type: array + x-go-name: Targets + type: object + x-go-package: github.com/go-gost/x/config + HandlerConfig: + properties: + auth: + $ref: '#/definitions/AuthConfig' + auther: + type: string + x-go-name: Auther + authers: + items: + type: string + type: array + x-go-name: Authers + chain: + type: string + x-go-name: Chain + chainGroup: + $ref: '#/definitions/ChainGroupConfig' + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + retries: + format: int64 + type: integer + x-go-name: Retries + tls: + $ref: '#/definitions/TLSConfig' + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + HopConfig: + properties: + bypass: + type: string + x-go-name: Bypass + bypasses: + items: + type: string + type: array + x-go-name: Bypasses + hosts: + type: string + x-go-name: Hosts + interface: + type: string + x-go-name: Interface + name: + type: string + x-go-name: Name + nodes: + items: + $ref: '#/definitions/NodeConfig' + type: array + x-go-name: Nodes + resolver: + type: string + x-go-name: Resolver + selector: + $ref: '#/definitions/SelectorConfig' + sockopts: + $ref: '#/definitions/SockOptsConfig' + type: object + x-go-package: github.com/go-gost/x/config + HostMappingConfig: + properties: + aliases: + items: + type: string + type: array + x-go-name: Aliases + hostname: + type: string + x-go-name: Hostname + ip: + type: string + x-go-name: IP + type: object + x-go-package: github.com/go-gost/x/config + HostsConfig: + properties: + file: + $ref: '#/definitions/FileLoader' + mappings: + items: + $ref: '#/definitions/HostMappingConfig' + type: array + x-go-name: Mappings + name: + type: string + x-go-name: Name + redis: + $ref: '#/definitions/RedisLoader' + reload: + $ref: '#/definitions/Duration' + type: object + x-go-package: github.com/go-gost/x/config + ListenerConfig: + properties: + auth: + $ref: '#/definitions/AuthConfig' + auther: + type: string + x-go-name: Auther + authers: + items: + type: string + type: array + x-go-name: Authers + chain: + type: string + x-go-name: Chain + chainGroup: + $ref: '#/definitions/ChainGroupConfig' + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + tls: + $ref: '#/definitions/TLSConfig' + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + LogConfig: + properties: + format: + type: string + x-go-name: Format + level: + type: string + x-go-name: Level + output: + type: string + x-go-name: Output + type: object + x-go-package: github.com/go-gost/x/config + MetricsConfig: + properties: + addr: + type: string + x-go-name: Addr + path: + type: string + x-go-name: Path + type: object + x-go-package: github.com/go-gost/x/config + NameserverConfig: + properties: + addr: + type: string + x-go-name: Addr + chain: + type: string + x-go-name: Chain + clientIP: + type: string + x-go-name: ClientIP + hostname: + type: string + x-go-name: Hostname + prefer: + type: string + x-go-name: Prefer + timeout: + $ref: '#/definitions/Duration' + ttl: + $ref: '#/definitions/Duration' + type: object + x-go-package: github.com/go-gost/x/config + NodeConfig: + properties: + addr: + type: string + x-go-name: Addr + bypass: + type: string + x-go-name: Bypass + bypasses: + items: + type: string + type: array + x-go-name: Bypasses + connector: + $ref: '#/definitions/ConnectorConfig' + dialer: + $ref: '#/definitions/DialerConfig' + hosts: + type: string + x-go-name: Hosts + interface: + type: string + x-go-name: Interface + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + name: + type: string + x-go-name: Name + resolver: + type: string + x-go-name: Resolver + sockopts: + $ref: '#/definitions/SockOptsConfig' + type: object + x-go-package: github.com/go-gost/x/config + ProfilingConfig: + properties: + addr: + type: string + x-go-name: Addr + type: object + x-go-package: github.com/go-gost/x/config + RecorderConfig: + properties: + file: + $ref: '#/definitions/FileRecorder' + name: + type: string + x-go-name: Name + redis: + $ref: '#/definitions/RedisRecorder' + type: object + x-go-package: github.com/go-gost/x/config + RecorderObject: + properties: + name: + type: string + x-go-name: Name + record: + type: string + x-go-name: Record + type: object + x-go-package: github.com/go-gost/x/config + RedisLoader: + properties: + addr: + type: string + x-go-name: Addr + db: + format: int64 + type: integer + x-go-name: DB + key: + type: string + x-go-name: Key + password: + type: string + x-go-name: Password + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + RedisRecorder: + properties: + addr: + type: string + x-go-name: Addr + db: + format: int64 + type: integer + x-go-name: DB + key: + type: string + x-go-name: Key + password: + type: string + x-go-name: Password + type: + type: string + x-go-name: Type + type: object + x-go-package: github.com/go-gost/x/config + ResolverConfig: + properties: + name: + type: string + x-go-name: Name + nameservers: + items: + $ref: '#/definitions/NameserverConfig' + type: array + x-go-name: Nameservers + type: object + x-go-package: github.com/go-gost/x/config + Response: + properties: + code: + format: int64 + type: integer + x-go-name: Code + msg: + type: string + x-go-name: Msg + type: object + x-go-package: github.com/go-gost/x/api + SelectorConfig: + properties: + failTimeout: + $ref: '#/definitions/Duration' + maxFails: + format: int64 + type: integer + x-go-name: MaxFails + strategy: + type: string + x-go-name: Strategy + type: object + x-go-package: github.com/go-gost/x/config + ServiceConfig: + properties: + addr: + type: string + x-go-name: Addr + admission: + type: string + x-go-name: Admission + admissions: + items: + type: string + type: array + x-go-name: Admissions + bypass: + type: string + x-go-name: Bypass + bypasses: + items: + type: string + type: array + x-go-name: Bypasses + forwarder: + $ref: '#/definitions/ForwarderConfig' + handler: + $ref: '#/definitions/HandlerConfig' + hosts: + type: string + x-go-name: Hosts + interface: + type: string + x-go-name: Interface + listener: + $ref: '#/definitions/ListenerConfig' + metadata: + additionalProperties: {} + type: object + x-go-name: Metadata + name: + type: string + x-go-name: Name + recorders: + items: + $ref: '#/definitions/RecorderObject' + type: array + x-go-name: Recorders + resolver: + type: string + x-go-name: Resolver + sockopts: + $ref: '#/definitions/SockOptsConfig' + type: object + x-go-package: github.com/go-gost/x/config + SockOptsConfig: + properties: + mark: + format: int64 + type: integer + x-go-name: Mark + type: object + x-go-package: github.com/go-gost/x/config + TLSConfig: + properties: + caFile: + type: string + x-go-name: CAFile + certFile: + type: string + x-go-name: CertFile + commonName: + type: string + x-go-name: CommonName + keyFile: + type: string + x-go-name: KeyFile + organization: + type: string + x-go-name: Organization + secure: + type: boolean + x-go-name: Secure + serverName: + type: string + x-go-name: ServerName + validity: + $ref: '#/definitions/Duration' + type: object + x-go-package: github.com/go-gost/x/config info: - title: Documentation of Web API. - version: 1.0.0 + title: Documentation of Web API. + version: 1.0.0 paths: - /config: - get: - operationId: getConfigRequest - parameters: - - description: output format, one of yaml|json, default is json. - in: query - name: format - type: string - x-go-name: Format - responses: - "200": - $ref: '#/responses/getConfigResponse' - security: - - basicAuth: - - '[]' - summary: Get current config. - tags: - - ConfigManagement - post: - operationId: saveConfigRequest - parameters: - - description: output format, one of yaml|json, default is yaml. - in: query - name: format - type: string - x-go-name: Format - responses: - "200": - $ref: '#/responses/saveConfigResponse' - security: - - basicAuth: - - '[]' - summary: Save current config to file (gost.yaml or gost.json). - tags: - - ConfigManagement - /config/admissions: - post: - operationId: createAdmissionRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/AdmissionConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createAdmissionResponse' - security: - - basicAuth: - - '[]' - summary: Create a new admission, the name of admission must be unique in admission - list. - tags: - - ConfigManagement - /config/admissions/{admission}: - delete: - operationId: deleteAdmissionRequest - parameters: - - in: path - name: admission - required: true - type: string - x-go-name: Admission - responses: - "200": - $ref: '#/responses/deleteAdmissionResponse' - security: - - basicAuth: - - '[]' - summary: Delete admission by name. - tags: - - ConfigManagement - put: - operationId: updateAdmissionRequest - parameters: - - in: path - name: admission - required: true - type: string - x-go-name: Admission - - in: body - name: data - schema: - $ref: '#/definitions/AdmissionConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateAdmissionResponse' - security: - - basicAuth: - - '[]' - summary: Update admission by name, the admission must already exist. - tags: - - ConfigManagement - /config/authers: - post: - operationId: createAutherRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/AutherConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createAutherResponse' - security: - - basicAuth: - - '[]' - summary: Create a new auther, the name of the auther must be unique in auther - list. - tags: - - ConfigManagement - /config/authers/{auther}: - delete: - operationId: deleteAutherRequest - parameters: - - in: path - name: auther - required: true - type: string - x-go-name: Auther - responses: - "200": - $ref: '#/responses/deleteAutherResponse' - security: - - basicAuth: - - '[]' - summary: Delete auther by name. - tags: - - ConfigManagement - put: - operationId: updateAutherRequest - parameters: - - in: path - name: auther - required: true - type: string - x-go-name: Auther - - in: body - name: data - schema: - $ref: '#/definitions/AutherConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateAutherResponse' - security: - - basicAuth: - - '[]' - summary: Update auther by name, the auther must already exist. - tags: - - ConfigManagement - /config/bypasses: - post: - operationId: createBypassRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/BypassConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createBypassResponse' - security: - - basicAuth: - - '[]' - summary: Create a new bypass, the name of bypass must be unique in bypass list. - tags: - - ConfigManagement - /config/bypasses/{bypass}: - delete: - operationId: deleteBypassRequest - parameters: - - in: path - name: bypass - required: true - type: string - x-go-name: Bypass - responses: - "200": - $ref: '#/responses/deleteBypassResponse' - security: - - basicAuth: - - '[]' - summary: Delete bypass by name. - tags: - - ConfigManagement - put: - operationId: updateBypassRequest - parameters: - - in: path - name: bypass - required: true - type: string - x-go-name: Bypass - - in: body - name: data - schema: - $ref: '#/definitions/BypassConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateBypassResponse' - security: - - basicAuth: - - '[]' - summary: Update bypass by name, the bypass must already exist. - tags: - - ConfigManagement - /config/chains: - post: - operationId: createChainRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/ChainConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createChainResponse' - security: - - basicAuth: - - '[]' - summary: Create a new chain, the name of chain must be unique in chain list. - tags: - - ConfigManagement - /config/chains/{chain}: - delete: - operationId: deleteChainRequest - parameters: - - in: path - name: chain - required: true - type: string - x-go-name: Chain - responses: - "200": - $ref: '#/responses/deleteChainResponse' - security: - - basicAuth: - - '[]' - summary: Delete chain by name. - tags: - - ConfigManagement - put: - operationId: updateChainRequest - parameters: - - in: path - name: chain - required: true - type: string - x-go-name: Chain - - in: body - name: data - schema: - $ref: '#/definitions/ChainConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateChainResponse' - security: - - basicAuth: - - '[]' - summary: Update chain by name, the chain must already exist. - tags: - - ConfigManagement - /config/hosts: - post: - operationId: createHostsRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/HostsConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createHostsResponse' - security: - - basicAuth: - - '[]' - summary: Create a new hosts, the name of the hosts must be unique in hosts list. - tags: - - ConfigManagement - /config/hosts/{hosts}: - delete: - operationId: deleteHostsRequest - parameters: - - in: path - name: hosts - required: true - type: string - x-go-name: Hosts - responses: - "200": - $ref: '#/responses/deleteHostsResponse' - security: - - basicAuth: - - '[]' - summary: Delete hosts by name. - tags: - - ConfigManagement - put: - operationId: updateHostsRequest - parameters: - - in: path - name: hosts - required: true - type: string - x-go-name: Hosts - - in: body - name: data - schema: - $ref: '#/definitions/HostsConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateHostsResponse' - security: - - basicAuth: - - '[]' - summary: Update hosts by name, the hosts must already exist. - tags: - - ConfigManagement - /config/resolvers: - post: - operationId: createResolverRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/ResolverConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createResolverResponse' - security: - - basicAuth: - - '[]' - summary: Create a new resolver, the name of the resolver must be unique in resolver - list. - tags: - - ConfigManagement - /config/resolvers/{resolver}: - delete: - operationId: deleteResolverRequest - parameters: - - in: path - name: resolver - required: true - type: string - x-go-name: Resolver - responses: - "200": - $ref: '#/responses/deleteResolverResponse' - security: - - basicAuth: - - '[]' - summary: Delete resolver by name. - tags: - - ConfigManagement - put: - operationId: updateResolverRequest - parameters: - - in: path - name: resolver - required: true - type: string - x-go-name: Resolver - - in: body - name: data - schema: - $ref: '#/definitions/ResolverConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateResolverResponse' - security: - - basicAuth: - - '[]' - summary: Update resolver by name, the resolver must already exist. - tags: - - ConfigManagement - /config/services: - post: - operationId: createServiceRequest - parameters: - - in: body - name: data - schema: - $ref: '#/definitions/ServiceConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/createServiceResponse' - security: - - basicAuth: - - '[]' - summary: Create a new service, the name of the service must be unique in service - list. - tags: - - ConfigManagement - /config/services/{service}: - delete: - operationId: deleteServiceRequest - parameters: - - in: path - name: service - required: true - type: string - x-go-name: Service - responses: - "200": - $ref: '#/responses/deleteServiceResponse' - security: - - basicAuth: - - '[]' - summary: Delete service by name. - tags: - - ConfigManagement - put: - operationId: updateServiceRequest - parameters: - - in: path - name: service - required: true - type: string - x-go-name: Service - - in: body - name: data - schema: - $ref: '#/definitions/ServiceConfig' - x-go-name: Data - responses: - "200": - $ref: '#/responses/updateServiceResponse' - security: - - basicAuth: - - '[]' - summary: Update service by name, the service must already exist. - tags: - - ConfigManagement + /config: + get: + operationId: getConfigRequest + parameters: + - description: output format, one of yaml|json, default is json. + in: query + name: format + type: string + x-go-name: Format + responses: + "200": + $ref: '#/responses/getConfigResponse' + security: + - basicAuth: + - '[]' + summary: Get current config. + tags: + - ConfigManagement + post: + operationId: saveConfigRequest + parameters: + - description: output format, one of yaml|json, default is yaml. + in: query + name: format + type: string + x-go-name: Format + responses: + "200": + $ref: '#/responses/saveConfigResponse' + security: + - basicAuth: + - '[]' + summary: Save current config to file (gost.yaml or gost.json). + tags: + - ConfigManagement + /config/admissions: + post: + operationId: createAdmissionRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/AdmissionConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createAdmissionResponse' + security: + - basicAuth: + - '[]' + summary: Create a new admission, the name of admission must be unique in admission list. + tags: + - ConfigManagement + /config/admissions/{admission}: + delete: + operationId: deleteAdmissionRequest + parameters: + - in: path + name: admission + required: true + type: string + x-go-name: Admission + responses: + "200": + $ref: '#/responses/deleteAdmissionResponse' + security: + - basicAuth: + - '[]' + summary: Delete admission by name. + tags: + - ConfigManagement + put: + operationId: updateAdmissionRequest + parameters: + - in: path + name: admission + required: true + type: string + x-go-name: Admission + - in: body + name: data + schema: + $ref: '#/definitions/AdmissionConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateAdmissionResponse' + security: + - basicAuth: + - '[]' + summary: Update admission by name, the admission must already exist. + tags: + - ConfigManagement + /config/authers: + post: + operationId: createAutherRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/AutherConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createAutherResponse' + security: + - basicAuth: + - '[]' + summary: Create a new auther, the name of the auther must be unique in auther list. + tags: + - ConfigManagement + /config/authers/{auther}: + delete: + operationId: deleteAutherRequest + parameters: + - in: path + name: auther + required: true + type: string + x-go-name: Auther + responses: + "200": + $ref: '#/responses/deleteAutherResponse' + security: + - basicAuth: + - '[]' + summary: Delete auther by name. + tags: + - ConfigManagement + put: + operationId: updateAutherRequest + parameters: + - in: path + name: auther + required: true + type: string + x-go-name: Auther + - in: body + name: data + schema: + $ref: '#/definitions/AutherConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateAutherResponse' + security: + - basicAuth: + - '[]' + summary: Update auther by name, the auther must already exist. + tags: + - ConfigManagement + /config/bypasses: + post: + operationId: createBypassRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/BypassConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createBypassResponse' + security: + - basicAuth: + - '[]' + summary: Create a new bypass, the name of bypass must be unique in bypass list. + tags: + - ConfigManagement + /config/bypasses/{bypass}: + delete: + operationId: deleteBypassRequest + parameters: + - in: path + name: bypass + required: true + type: string + x-go-name: Bypass + responses: + "200": + $ref: '#/responses/deleteBypassResponse' + security: + - basicAuth: + - '[]' + summary: Delete bypass by name. + tags: + - ConfigManagement + put: + operationId: updateBypassRequest + parameters: + - in: path + name: bypass + required: true + type: string + x-go-name: Bypass + - in: body + name: data + schema: + $ref: '#/definitions/BypassConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateBypassResponse' + security: + - basicAuth: + - '[]' + summary: Update bypass by name, the bypass must already exist. + tags: + - ConfigManagement + /config/chains: + post: + operationId: createChainRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/ChainConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createChainResponse' + security: + - basicAuth: + - '[]' + summary: Create a new chain, the name of chain must be unique in chain list. + tags: + - ConfigManagement + /config/chains/{chain}: + delete: + operationId: deleteChainRequest + parameters: + - in: path + name: chain + required: true + type: string + x-go-name: Chain + responses: + "200": + $ref: '#/responses/deleteChainResponse' + security: + - basicAuth: + - '[]' + summary: Delete chain by name. + tags: + - ConfigManagement + put: + operationId: updateChainRequest + parameters: + - in: path + name: chain + required: true + type: string + x-go-name: Chain + - in: body + name: data + schema: + $ref: '#/definitions/ChainConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateChainResponse' + security: + - basicAuth: + - '[]' + summary: Update chain by name, the chain must already exist. + tags: + - ConfigManagement + /config/hosts: + post: + operationId: createHostsRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/HostsConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createHostsResponse' + security: + - basicAuth: + - '[]' + summary: Create a new hosts, the name of the hosts must be unique in hosts list. + tags: + - ConfigManagement + /config/hosts/{hosts}: + delete: + operationId: deleteHostsRequest + parameters: + - in: path + name: hosts + required: true + type: string + x-go-name: Hosts + responses: + "200": + $ref: '#/responses/deleteHostsResponse' + security: + - basicAuth: + - '[]' + summary: Delete hosts by name. + tags: + - ConfigManagement + put: + operationId: updateHostsRequest + parameters: + - in: path + name: hosts + required: true + type: string + x-go-name: Hosts + - in: body + name: data + schema: + $ref: '#/definitions/HostsConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateHostsResponse' + security: + - basicAuth: + - '[]' + summary: Update hosts by name, the hosts must already exist. + tags: + - ConfigManagement + /config/resolvers: + post: + operationId: createResolverRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/ResolverConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createResolverResponse' + security: + - basicAuth: + - '[]' + summary: Create a new resolver, the name of the resolver must be unique in resolver list. + tags: + - ConfigManagement + /config/resolvers/{resolver}: + delete: + operationId: deleteResolverRequest + parameters: + - in: path + name: resolver + required: true + type: string + x-go-name: Resolver + responses: + "200": + $ref: '#/responses/deleteResolverResponse' + security: + - basicAuth: + - '[]' + summary: Delete resolver by name. + tags: + - ConfigManagement + put: + operationId: updateResolverRequest + parameters: + - in: path + name: resolver + required: true + type: string + x-go-name: Resolver + - in: body + name: data + schema: + $ref: '#/definitions/ResolverConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateResolverResponse' + security: + - basicAuth: + - '[]' + summary: Update resolver by name, the resolver must already exist. + tags: + - ConfigManagement + /config/services: + post: + operationId: createServiceRequest + parameters: + - in: body + name: data + schema: + $ref: '#/definitions/ServiceConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/createServiceResponse' + security: + - basicAuth: + - '[]' + summary: Create a new service, the name of the service must be unique in service list. + tags: + - ConfigManagement + /config/services/{service}: + delete: + operationId: deleteServiceRequest + parameters: + - in: path + name: service + required: true + type: string + x-go-name: Service + responses: + "200": + $ref: '#/responses/deleteServiceResponse' + security: + - basicAuth: + - '[]' + summary: Delete service by name. + tags: + - ConfigManagement + put: + operationId: updateServiceRequest + parameters: + - in: path + name: service + required: true + type: string + x-go-name: Service + - in: body + name: data + schema: + $ref: '#/definitions/ServiceConfig' + x-go-name: Data + responses: + "200": + $ref: '#/responses/updateServiceResponse' + security: + - basicAuth: + - '[]' + summary: Update service by name, the service must already exist. + tags: + - ConfigManagement produces: -- application/json + - application/json responses: - createAdmissionResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createAutherResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createBypassResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createChainResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createHostsResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createResolverResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - createServiceResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteAdmissionResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteAutherResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteBypassResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteChainResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteHostsResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteResolverResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - deleteServiceResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - getConfigResponse: - description: successful operation. - headers: - Config: {} - schema: - $ref: '#/definitions/Config' - saveConfigResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateAdmissionResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateAutherResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateBypassResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateChainResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateHostsResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateResolverResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' - updateServiceResponse: - description: successful operation. - headers: - Data: {} - schema: - $ref: '#/definitions/Response' + createAdmissionResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createAutherResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createBypassResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createChainResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createHostsResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createResolverResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + createServiceResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteAdmissionResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteAutherResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteBypassResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteChainResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteHostsResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteResolverResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + deleteServiceResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + getConfigResponse: + description: successful operation. + headers: + Config: {} + schema: + $ref: '#/definitions/Config' + saveConfigResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateAdmissionResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateAutherResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateBypassResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateChainResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateHostsResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateResolverResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' + updateServiceResponse: + description: successful operation. + headers: + Data: {} + schema: + $ref: '#/definitions/Response' schemes: -- https -- http + - https + - http securityDefinitions: - basicAuth: - type: basic + basicAuth: + type: basic swagger: "2.0" diff --git a/config/config.go b/config/config.go index 19a25ff..1b1323b 100644 --- a/config/config.go +++ b/config/config.go @@ -247,13 +247,14 @@ type ServiceConfig struct { Handler *HandlerConfig `yaml:",omitempty" json:"handler,omitempty"` Listener *ListenerConfig `yaml:",omitempty" json:"listener,omitempty"` Forwarder *ForwarderConfig `yaml:",omitempty" json:"forwarder,omitempty"` + Metadata map[string]any `yaml:",omitempty" json:"metadata,omitempty"` } type ChainConfig struct { Name string `json:"name"` Selector *SelectorConfig `yaml:",omitempty" json:"selector,omitempty"` Hops []*HopConfig `json:"hops"` - Metadata map[string]any `yaml:",omitempty", json:"metadata,omitempty"` + Metadata map[string]any `yaml:",omitempty" json:"metadata,omitempty"` } type ChainGroupConfig struct { @@ -284,7 +285,7 @@ type NodeConfig struct { Hosts string `yaml:",omitempty" json:"hosts,omitempty"` Connector *ConnectorConfig `yaml:",omitempty" json:"connector,omitempty"` Dialer *DialerConfig `yaml:",omitempty" json:"dialer,omitempty"` - Metadata map[string]any `yaml:",omitempty", json:"metadata,omitempty"` + Metadata map[string]any `yaml:",omitempty" json:"metadata,omitempty"` } type Config struct {