Documentation ¶
Index ¶
- Constants
- Variables
- func FixEngineConfigFile(cfg Configer, deleteMode ...bool) (bool, error)
- func GetCtxStderr(c context.Context) io.Writer
- func GetCtxStdout(c context.Context) io.Writer
- func ParseContainerInfo(parts []string) (string, string)
- func RemoveCertFile(cfg Configer, id uint) error
- func RemoveVhostConfigFile(cfg Configer, id uint) error
- func RenewalCert(cfg Configer, ctx context.Context, id uint, domains []string, email string) error
- func Thirdparty() []echo.KV
- func WithStderr(c context.Context, w io.Writer) context.Context
- func WithStdout(c context.Context, w io.Writer) context.Context
- func WithStdoutStderr(c context.Context, w ...io.Writer) context.Context
- type APIClient
- type CertFileRemover
- type CertPathFormat
- type CertPathFormatGetter
- type CertRenewaler
- type CommonConfig
- func (c *CommonConfig) CopyFrom(m *dbschema.NgingVhostServer)
- func (c *CommonConfig) EngineConfigFile() string
- func (c *CommonConfig) Exec(ctx context.Context, args ...string) ([]byte, error)
- func (c *CommonConfig) FixVhostDirPath(vhostDir string) string
- func (c *CommonConfig) GetCertContainerDir() string
- func (c *CommonConfig) GetCertLocalDir() string
- func (c *CommonConfig) GetEngine() string
- func (c *CommonConfig) GetEngineConfigContainerFile() string
- func (c *CommonConfig) GetEngineConfigLocalFile() string
- func (c *CommonConfig) GetEnviron() string
- func (c *CommonConfig) GetIdent() string
- func (c *CommonConfig) GetTemplateFile() string
- func (c *CommonConfig) GetVhostConfigContainerDir() string
- func (c *CommonConfig) GetVhostConfigLocalDir() string
- func (c *CommonConfig) RemoveDir(typeName string, rootDir string, prefix string, extensions ...string) error
- func (c *CommonConfig) VhostConfigDir() string
- type Configer
- type ContextKey
- type EngineConfigFileFixer
- type Enginer
- type ParsedCommand
- type RequestDockerExec
- type VhostConfigRemover
Constants ¶
View Source
const ( EnvironLocal = `local` EnvironContainer = `container` )
View Source
const (
NgingConfigPrefix = `nging_`
)
Variables ¶
View Source
var ( ErrNotSetCertContainerDir = errors.New(`CertContainerDir value is not set`) ErrNotSetCertLocalDir = errors.New(`CertLocalDir value is not set`) ErrNotSetEngineConfigLocalFile = errors.New(`EngineConfigLocalFile value is not set`) ErrNotSetEngineConfigContainerFile = errors.New(`EngineConfigContainerFile value is not set`) ErrNotSetVhostConfigLocalDir = errors.New(`VhostConfigLocalDir value is not set`) ErrNotSetVhostConfigContainerDir = errors.New(`VhostConfigContainerDir value is not set`) )
View Source
var Engines = echo.NewKVData()
View Source
var Environs = echo.NewKVData().Add(EnvironLocal, `本机`).Add(EnvironContainer, `容器`)
Functions ¶
func ParseContainerInfo ¶
func RemoveCertFile ¶
func RemoveVhostConfigFile ¶
如果 id 为 0 代表删除此配置下的所有其它文件
func RenewalCert ¶
func Thirdparty ¶
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func NewAPIClient ¶
NewAPIClient("cert.pem", "key.pem")
type CertFileRemover ¶
type CertPathFormat ¶
type CertPathFormatGetter ¶
type CertPathFormatGetter interface {
GetCertPathFormat() CertPathFormat
}
type CertRenewaler ¶
type CommonConfig ¶
type CommonConfig struct { ID string Command string Endpoint string CmdWithConfig bool WorkDir string EnvVars []string Environ string EngineConfigLocalFile string EngineConfigContainerFile string VhostConfigLocalDir string VhostConfigContainerDir string CertLocalDir string CertContainerDir string // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(engineName, templateFile string) *CommonConfig
func (*CommonConfig) CopyFrom ¶
func (c *CommonConfig) CopyFrom(m *dbschema.NgingVhostServer)
func (*CommonConfig) EngineConfigFile ¶
func (c *CommonConfig) EngineConfigFile() string
func (*CommonConfig) FixVhostDirPath ¶
func (c *CommonConfig) FixVhostDirPath(vhostDir string) string
func (*CommonConfig) GetCertContainerDir ¶
func (c *CommonConfig) GetCertContainerDir() string
func (*CommonConfig) GetCertLocalDir ¶
func (c *CommonConfig) GetCertLocalDir() string
func (*CommonConfig) GetEngine ¶
func (c *CommonConfig) GetEngine() string
func (*CommonConfig) GetEngineConfigContainerFile ¶
func (c *CommonConfig) GetEngineConfigContainerFile() string
func (*CommonConfig) GetEngineConfigLocalFile ¶
func (c *CommonConfig) GetEngineConfigLocalFile() string
func (*CommonConfig) GetEnviron ¶
func (c *CommonConfig) GetEnviron() string
func (*CommonConfig) GetIdent ¶
func (c *CommonConfig) GetIdent() string
func (*CommonConfig) GetTemplateFile ¶
func (c *CommonConfig) GetTemplateFile() string
func (*CommonConfig) GetVhostConfigContainerDir ¶
func (c *CommonConfig) GetVhostConfigContainerDir() string
func (*CommonConfig) GetVhostConfigLocalDir ¶
func (c *CommonConfig) GetVhostConfigLocalDir() string
func (*CommonConfig) VhostConfigDir ¶
func (c *CommonConfig) VhostConfigDir() string
type Configer ¶
type Configer interface { GetVhostConfigLocalDirAbs() (string, error) GetTemplateFile() string GetIdent() string GetEngine() string GetEnviron() string GetCertLocalDir() string GetCertContainerDir() string GetVhostConfigLocalDir() string GetVhostConfigContainerDir() string GetEngineConfigLocalFile() string GetEngineConfigContainerFile() string }
type ContextKey ¶
type ContextKey string
const CtxKeyStderr ContextKey = `stderr`
const CtxKeyStdout ContextKey = `stdout`
type EngineConfigFileFixer ¶
type ParsedCommand ¶
type RequestDockerExec ¶
type RequestDockerExec struct { AttachStdin bool `json:",omitempty"` AttachStdout bool `json:",omitempty"` AttachStderr bool `json:",omitempty"` DetachKeys string `json:",omitempty"` //"ctrl-p,ctrl-q", Tty bool `json:",omitempty"` Cmd []string `json:",omitempty"` // ["date"], Env []string `json:",omitempty"` // ["FOO=bar","BAZ=quux"] }
documention: https://docs.docker.com/engine/api/v1.43/#tag/Exec/operation/ContainerExec API: /containers/{id}/exec
type VhostConfigRemover ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.