File: api.go

package info (click to toggle)
rootlesskit 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates
  • size: 636 kB
  • sloc: sh: 433; makefile: 25
file content (34 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package api

import "net"

const (
	// Version of the REST API, not implementation version.
	// See openapi.yaml for the definition.
	Version = "1.1.1"
)

// Info is the structure returned by `GET /info`
type Info struct {
	APIVersion    string             `json:"apiVersion"` // REST API version
	Version       string             `json:"version"`    // Implementation version
	StateDir      string             `json:"stateDir"`
	ChildPID      int                `json:"childPID"`
	NetworkDriver *NetworkDriverInfo `json:"networkDriver,omitempty"`
	PortDriver    *PortDriverInfo    `json:"portDriver,omitempty"`
}

// NetworkDriverInfo in Info
type NetworkDriverInfo struct {
	Driver         string   `json:"driver"`
	DNS            []net.IP `json:"dns,omitempty"`
	ChildIP        net.IP   `json:"childIP,omitempty"`        // since API v1.1.1 (RootlessKit v0.14.1)
	DynamicChildIP bool     `json:"dynamicChildIP,omitempty"` // since API v1.1.1
}

// PortDriverInfo in Info
type PortDriverInfo struct {
	Driver                  string   `json:"driver"`
	Protos                  []string `json:"protos"`
	DisallowLoopbackChildIP bool     `json:"disallowLoopbackChildIP,omitempty"` // since API v1.1.1
}