Documentation
¶
Index ¶
- Constants
- Variables
- func ListenToNewSock(newsock string, sigc chan os.Signal) (l net.Listener, err error)
- func ReadLineFile(reader io.Reader) (patterns []string, err error)
- type Headers
- type Proxy
- type ProxyOption
- func WithBindMounts(bm []string) ProxyOption
- func WithCudaLibPath(s string) ProxyOption
- func WithDebugEnabled() ProxyOption
- func WithDebugValue(d bool) ProxyOption
- func WithDevMappings(dm []string) ProxyOption
- func WithDockerSocket(s string) ProxyOption
- func WithGpuValue(b bool) ProxyOption
- func WithPattern(p string) ProxyOption
- func WithPatterns(p []string) ProxyOption
- func WithPinUser(pub bool, pu string) ProxyOption
- func WithProxySocket(s string) ProxyOption
- type ProxyOptions
- type UnixSocket
- type UpStream
Constants ¶
View Source
const ( DOCKER_SOCKET = "/var/run/docker.sock" PROXY_SOCKET = "/tmp/doxy.sock" PATTERN_FILE = "/etc/doxy.pattern" DEVICE_FILE = "/etc/doxy.devices" )
Variables ¶
View Source
var ( DEF_PAT = []string{ `^/(v\d\.\d+/)?containers(/\w+)?/(json|stats|top)$`, `^/(v\d\.\d+/)?services(/[0-9a-f]+)?$`, `^/(v\d\.\d+/)?tasks(/\w+)?$`, `^/(v\d\.\d+/)?networks(/\w+)?$`, `^/(v\d\.\d+/)?volumes(/\w+)?$`, `^/(v\d\.\d+/)?nodes(/\w+)?$`, `^/(v\d\.\d+/)?info$`, `^/(v\d\.\d+/)?version$`, "^/_ping$", } HPC_PAT = []string{ `^/(v\d\.\d+/)?containers(/\w+)?/(json|stats|top|logs|wait|create|start|run|kill)$`, `^/(v\d\.\d+/)?images(/\w+)?/(json|pull|create)$`, `^/(v\d\.\d+/)?info$`, `^/(v\d\.\d+/)?images/(pull|create)$`, `^/(v\d\.\d+/)?version$`, "^/_ping$", } GPUS = []string{ "/dev/nvidia0:/dev/nvidia0:rwm", "/dev/nvidiactl:/dev/nvidiactl:rwm", } PATTERNS = map[string][]string{ "default": DEF_PAT, "hpc": HPC_PAT, } )
Functions ¶
func ListenToNewSock ¶
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func NewProxy ¶
func NewProxy(opts ...ProxyOption) Proxy
func (*Proxy) GetOptions ¶ added in v0.1.2
type ProxyOption ¶ added in v0.1.2
type ProxyOption func(*ProxyOptions)
func WithBindMounts ¶ added in v0.2.0
func WithBindMounts(bm []string) ProxyOption
func WithCudaLibPath ¶ added in v0.2.5
func WithCudaLibPath(s string) ProxyOption
func WithDebugEnabled ¶ added in v0.1.2
func WithDebugEnabled() ProxyOption
func WithDebugValue ¶ added in v0.1.2
func WithDebugValue(d bool) ProxyOption
func WithDevMappings ¶ added in v0.2.0
func WithDevMappings(dm []string) ProxyOption
func WithDockerSocket ¶ added in v0.1.2
func WithDockerSocket(s string) ProxyOption
func WithGpuValue ¶ added in v0.2.0
func WithGpuValue(b bool) ProxyOption
func WithPattern ¶ added in v0.1.2
func WithPattern(p string) ProxyOption
func WithPatterns ¶ added in v0.1.2
func WithPatterns(p []string) ProxyOption
func WithPinUser ¶ added in v0.2.3
func WithPinUser(pub bool, pu string) ProxyOption
func WithProxySocket ¶ added in v0.1.2
func WithProxySocket(s string) ProxyOption
type ProxyOptions ¶ added in v0.1.2
type UnixSocket ¶
type UnixSocket struct {
// contains filtered or unexported fields
}
UnixSocket just provides the path, so that I can test it
func NewUnixSocket ¶
func NewUnixSocket(path string) UnixSocket
NewUnixSocket return a socket using the path
type UpStream ¶
type UpStream struct { Name string // contains filtered or unexported fields }
UpStream creates upstream handler struct
func NewUpstream ¶
func NewUpstream(socket string, regs []string, binds []string, devs []string, gpu bool, pinUser string, pinUserB bool, cudaLibPath string) *UpStream
NewUpstream returns a new socket (magic)
func NewUpstreamPO ¶ added in v0.2.3
func NewUpstreamPO(po ProxyOptions) *UpStream
Click to show internal directories.
Click to hide internal directories.