types

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJsonResponse

func WriteJsonResponse(w http.ResponseWriter, err error, code MesCode, mes Mes, obj any)

Types

type Config

type Config struct {
	ProxyPort       int  `yaml:"proxy_port"`
	ApiPort         int  `yaml:"api_port"`
	GrpcPort        int  `yaml:"grpc_port"`
	ApiWriteTimeout int  `yaml:"api_write_timeout"`
	ApiReadTimeout  int  `yaml:"api_read_timeout"`
	ApiIdleTimeout  int  `yaml:"api_idle_timeout"`
	APIEnable       bool `yaml:"api_enable"`
	GRPCEnable      bool `yaml:"grpc_enable"`
}
var GConfig *Config

type ContainerInfo

type ContainerInfo struct {
	ID         string             `json:"Id"`
	Names      []string           `json:"names"`
	Image      string             `json:"image"`
	ImageID    string             `json:"image_id"`
	Command    string             `json:"command"`
	Created    int64              `json:"created"`
	Ports      []dockertypes.Port `json:"ports"`
	SizeRw     int64              `json:"size_rw,omitempty"`
	SizeRootFs int64              `json:",size_root_fs,omitempty"`
	Labels     map[string]string  `json:"labels"`
	State      string             `json:"state"`
	Status     string             `json:"status"`
	HostConfig struct {
		NetworkMode string `json:",omitempty"`
	} `json:"host_config,omitempty"`
	NetworkIds []string `json:"network_ids"`
}

type ContainerLog

type ContainerLog struct{}

type EmptyOjb

type EmptyOjb struct{}

type ImageInfo

type ImageInfo struct {
	// containers
	// Required: true
	Containers int64 `json:"Containers"`

	// created
	// Required: true
	Created int64 `json:"Created"`

	// Id
	// Required: true
	ID string `json:"Id"`

	// labels
	// Required: true
	Labels map[string]string `json:"Labels"`

	// parent Id
	// Required: true
	ParentID string `json:"ParentId"`

	// repo digests
	// Required: true
	RepoDigests []string `json:"RepoDigests"`

	// repo tags
	// Required: true
	RepoTags []string `json:"RepoTags"`

	// shared size
	// Required: true
	SharedSize int64 `json:"SharedSize"`

	// size
	// Required: true
	Size int64 `json:"Size"`

	// virtual size
	// Required: true
	VirtualSize int64 `json:"VirtualSize"`
}

type ImageLog

type ImageLog struct{}

type Mes

type Mes string
const (
	ErrMes      Mes = "Operate Failure"
	ErrParamMes Mes = "parameter is wrong"
	SucMes      Mes = "Operate Successfully"
)

type MesCode

type MesCode int
const (
	ErrCode MesCode = -1
	SucCode MesCode = 1
)

type NetworkInfo

type NetworkInfo struct {
	Name       string                                  // Name is the requested name of the network
	ID         string                                  `json:"Id"` // ID uniquely identifies a network on a single machine
	Created    time.Time                               // Created is the time the network created
	Scope      string                                  // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level)
	Driver     string                                  // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)
	EnableIPv6 bool                                    // EnableIPv6 represents whether to enable IPv6
	IPAM       dockernetwork.IPAM                      // IPAM is the network's IP Address Management
	Internal   bool                                    // Internal represents if the network is used internal only
	Attachable bool                                    // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode.
	Ingress    bool                                    // Ingress indicates the network is providing the routing-mesh for the swarm cluster.
	ConfigFrom dockernetwork.ConfigReference           // ConfigFrom specifies the source which will provide the configuration for this network.
	ConfigOnly bool                                    // ConfigOnly networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services.
	Containers map[string]dockertypes.EndpointResource // Containers contains endpoints belonging to the network
	Options    map[string]string                       // Options holds the network specific options to use for when creating the network
	Labels     map[string]string                       // Labels holds metadata specific to the network being created
	Peers      []dockernetwork.PeerInfo                `json:",omitempty"` // List of peer nodes for an overlay network
	Services   map[string]dockernetwork.ServiceInfo    `json:",omitempty"`
}

type ResponseObj

type ResponseObj[V any] struct {
	Code    MesCode `json:"code"`
	Mes     Mes     `json:"mes"`
	Content V       `json: "content"`
}

func NewResponseObj

func NewResponseObj[V any](mesCode MesCode, mes Mes, content V) ResponseObj[V]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL