Documentation
¶
Index ¶
- func MainClient(fn func(cfg *ClientConfig, m proxy.FileSystemMount) error)
- func OnInterrupt(f func())
- func ServiceMain(createfs func() ninep.FileSystem)
- func ServiceMainWithFactory(createcfg func(stdout, stderr io.Writer) ServerConfig, ...)
- func ServiceMainWithLogger(createfs func(L *slog.Logger) ninep.FileSystem)
- func SupportsColor(noColorHint bool)
- type ClientConfig
- func (c *ClientConfig) CreateClient(addr string) (ninep.Client, error)
- func (c *ClientConfig) CreateFs(addr string) (ninep.Client, *ninep.FileSystemProxy, error)
- func (c *ClientConfig) FSMount(mnt *proxy.FileSystemMountConfig) (proxy.FileSystemMount, error)
- func (c *ClientConfig) FSMountMany(cfgs []proxy.FileSystemMountConfig) ([]proxy.FileSystemMount, error)
- func (c *ClientConfig) SetFlags(f Flags)
- type Flags
- type ServerConfig
- func (c *ServerConfig) Close()
- func (c *ServerConfig) CreateServer(createfs func(L *slog.Logger) ninep.FileSystem) *ninep.Server
- func (c *ServerConfig) CreateServerAndListen(createfs func(L *slog.Logger) ninep.FileSystem) error
- func (c *ServerConfig) ListenAndServe(srv *ninep.Server) error
- func (c *ServerConfig) SetFlags(f Flags)
- type StdFlags
- func (f *StdFlags) BoolVar(p *bool, name string, defaultValue bool, help string)
- func (f *StdFlags) IntVar(p *int, name string, defaultValue int, help string)
- func (f *StdFlags) Parse() ([]string, error)
- func (f *StdFlags) ReadFileConfig(filename string) error
- func (f *StdFlags) StringVar(p *string, name string, defaultValue string, help string)
- func (f *StdFlags) Usage()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MainClient ¶
func MainClient(fn func(cfg *ClientConfig, m proxy.FileSystemMount) error)
func OnInterrupt ¶
func OnInterrupt(f func())
func ServiceMain ¶
func ServiceMain(createfs func() ninep.FileSystem)
ServiceMain starts a ninep.Server from a constructor of a ninep.FileSystem. The server takes responsibility for calling Close() on ninep.FileSystem on shutdown.
func ServiceMainWithFactory ¶
func ServiceMainWithFactory(createcfg func(stdout, stderr io.Writer) ServerConfig, createfs func() ninep.FileSystem)
func ServiceMainWithLogger ¶
func ServiceMainWithLogger(createfs func(L *slog.Logger) ninep.FileSystem)
ServiceMainWithLogger starts a ninep.Server from a constructor of a ninep.FileSystem. The server takes responsibility for calling Close() on ninep.FileSystem on shutdown. Logger is the configured logger available from cli args
func SupportsColor ¶
func SupportsColor(noColorHint bool)
Types ¶
type ClientConfig ¶
type ClientConfig struct {
LogLevel string
PrintTraceMessages bool
PrintErrorMessages bool
UseRecoverClient bool
PrintPrefix string
User string
Root string
TimeoutInSeconds int
Logger *slog.Logger
// contains filtered or unexported fields
}
ClientConfig provides configuration for an easy cli client
func (*ClientConfig) CreateClient ¶
func (c *ClientConfig) CreateClient(addr string) (ninep.Client, error)
func (*ClientConfig) CreateFs ¶
func (c *ClientConfig) CreateFs(addr string) (ninep.Client, *ninep.FileSystemProxy, error)
func (*ClientConfig) FSMount ¶
func (c *ClientConfig) FSMount(mnt *proxy.FileSystemMountConfig) (proxy.FileSystemMount, error)
func (*ClientConfig) FSMountMany ¶
func (c *ClientConfig) FSMountMany(cfgs []proxy.FileSystemMountConfig) ([]proxy.FileSystemMount, error)
func (*ClientConfig) SetFlags ¶
func (c *ClientConfig) SetFlags(f Flags)
type ServerConfig ¶
type ServerConfig struct {
Addr string
LogLevel string
CertFile string
KeyFile string
ReadTimeoutInSeconds int
MaxInflightRequestsPerSession int
Dialer ninep.Dialer // defaults to net
Stdout io.Writer
Stderr io.Writer
PrintHelp bool
MemProfile string
CpuProfile string
PrintPrefix string
Logger *slog.Logger
// contains filtered or unexported fields
}
func (*ServerConfig) Close ¶
func (c *ServerConfig) Close()
func (*ServerConfig) CreateServer ¶
func (c *ServerConfig) CreateServer(createfs func(L *slog.Logger) ninep.FileSystem) *ninep.Server
func (*ServerConfig) CreateServerAndListen ¶
func (c *ServerConfig) CreateServerAndListen(createfs func(L *slog.Logger) ninep.FileSystem) error
func (*ServerConfig) ListenAndServe ¶
func (c *ServerConfig) ListenAndServe(srv *ninep.Server) error
func (*ServerConfig) SetFlags ¶
func (c *ServerConfig) SetFlags(f Flags)
Click to show internal directories.
Click to hide internal directories.