Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigFileDir() string
- func ConfigFilePath() string
- func ContextsDir() string
- func ContextsMetaDir() string
- func ContextsTLSDir() string
- func HasSocket(name string) bool
- func HasSystemDockerSocket() bool
- func HasUserDockerSocket() bool
- func New(config *config.DockerClient) (*docker.Client, error)
- func UserDockerSocket() string
- func UserHomeDir() string
- type AuthConfig
- type DockerConfigFile
- type DockerContextMetadata
- type EndpointMetadata
- type ProxyConfig
- type SocketInfo
Constants ¶
View Source
const ( EnvDockerConfig = "DOCKER_CONFIG" EnvDockerContext = "DOCKER_CONTEXT" EnvDockerAPIVer = "DOCKER_API_VERSION" EnvDockerHost = "DOCKER_HOST" EnvDockerTLSVerify = "DOCKER_TLS_VERIFY" EnvDockerCertPath = "DOCKER_CERT_PATH" UnixSocketPath = "/var/run/docker.sock" UnixSocketAddr = "unix:///var/run/docker.sock" )
View Source
const ( DefaultContextName = "default" //does not have a context file (pseudo-context) DockerConfigFileName = "config.json" DockerMetaFileName = "meta.json" DockerEndpointType = "docker" )
Variables ¶
View Source
var EnvVarNames = []string{ EnvDockerHost, EnvDockerTLSVerify, EnvDockerCertPath, EnvDockerAPIVer, EnvDockerContext, }
View Source
var (
ErrNoDockerInfo = errors.New("no docker info")
)
Functions ¶
func ConfigFileDir ¶
func ConfigFileDir() string
func ConfigFilePath ¶
func ConfigFilePath() string
func ContextsDir ¶
func ContextsDir() string
func ContextsMetaDir ¶
func ContextsMetaDir() string
func ContextsTLSDir ¶
func ContextsTLSDir() string
func HasSystemDockerSocket ¶
func HasSystemDockerSocket() bool
func HasUserDockerSocket ¶
func HasUserDockerSocket() bool
func New ¶
func New(config *config.DockerClient) (*docker.Client, error)
New creates a new Docker client instance
func UserDockerSocket ¶
func UserDockerSocket() string
func UserHomeDir ¶
func UserHomeDir() string
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Auth string `json:"auth,omitempty"`
IdentityToken string `json:"identitytoken,omitempty"` //to auth user and get access token from registry
RegistryToken string `json:"registrytoken,omitempty"` //bearer token for registry
ServerAddress string `json:"serveraddress,omitempty"`
Email string `json:"email,omitempty"` //depricated field
}
type DockerConfigFile ¶
type DockerConfigFile struct {
CurrentContext string `json:"currentContext,omitempty"`
CredentialsStore string `json:"credsStore,omitempty"`
CredentialHelpers map[string]string `json:"credHelpers,omitempty"`
AuthConfigs map[string]AuthConfig `json:"auths"`
Proxies map[string]ProxyConfig `json:"proxies,omitempty"`
}
only relevant fields...
func ReadConfigFile ¶
func ReadConfigFile(filePath string) (*DockerConfigFile, error)
type DockerContextMetadata ¶
type DockerContextMetadata struct {
Name string
Metadata struct {
Description string
}
Endpoints map[string]EndpointMetadata
}
func ListContextsMetadata ¶
func ListContextsMetadata(dirPath string) ([]*DockerContextMetadata, error)
func ReadContextMetadataFile ¶
func ReadContextMetadataFile(filePath string) (*DockerContextMetadata, error)
func (*DockerContextMetadata) Endpoint ¶
func (ref *DockerContextMetadata) Endpoint() *EndpointMetadata
type EndpointMetadata ¶
type ProxyConfig ¶
type SocketInfo ¶
type SocketInfo struct {
Address string `json:"address"`
FilePath string `json:"file_path"`
FileType string `json:"type"`
FilePerms string `json:"perms"`
SymlinkTarget string `json:"symlink_target,omitempty"`
TargetPerms string `json:"target_perms,omitempty"`
TargetType string `json:"target_type,omitempty"`
CanRead bool `json:"can_read"`
CanWrite bool `json:"can_write"`
}
func GetUnixSocketAddr ¶
func GetUnixSocketAddr() (*SocketInfo, error)
Click to show internal directories.
Click to hide internal directories.