Documentation
¶
Overview ¶
internal/daemon/bind.go
internal/daemon/daemon.go
internal/daemon/lock.go
internal/daemon/pid.go
internal/daemon/rotlog.go
internal/daemon/run.go
Index ¶
- Variables
- func Run(cfg config.Config) error
- func SpawnDetached(selfPath string, extraArgs ...string) error
- type Clock
- type Core
- func (c *Core) ExpireDue(now time.Time)
- func (c *Core) FindByToken(tok string) (*share.Share, bool)
- func (c *Core) IdleFor(now time.Time) (time.Duration, bool)
- func (c *Core) Info(query string) (admin.InfoPayload, error)
- func (c *Core) List() admin.ListResponse
- func (c *Core) MarkExpired(id, reason string)
- func (c *Core) Reshare(id string) (admin.SharePayload, error)
- func (c *Core) RestoreFromHistory() error
- func (c *Core) Revoke(id string) error
- func (c *Core) Secret() string
- func (c *Core) Share(req admin.ShareRequest) (admin.SharePayload, error)
- func (c *Core) Status() admin.StatusResponse
- func (c *Core) Stop()
- func (c *Core) TouchAdmin()
- type Lockfile
- type Meta
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLocked = errors.New("daemon already running")
Functions ¶
func SpawnDetached ¶
SpawnDetached starts `selfPath daemon [extraArgs...]` in a detached process so the CLI can exit while the daemon continues running. extraArgs are passed before the "daemon" subcommand so flags like --config propagate correctly.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) List ¶
func (c *Core) List() admin.ListResponse
func (*Core) MarkExpired ¶
func (*Core) RestoreFromHistory ¶
func (*Core) Share ¶
func (c *Core) Share(req admin.ShareRequest) (admin.SharePayload, error)
func (*Core) Status ¶
func (c *Core) Status() admin.StatusResponse
func (*Core) TouchAdmin ¶
func (c *Core) TouchAdmin()
type Lockfile ¶
type Lockfile interface {
// Read returns the advisory metadata written into the file.
Read() (Meta, error)
// Write atomically replaces the file's content with m and fsyncs.
Write(m Meta) error
// Close releases the lock and closes the underlying handle.
Close() error
}
Lockfile represents the daemon's exclusive lock. The OS releases it on process exit, including crashes.
func AcquireLock ¶
AcquireLock obtains an exclusive lock on path. Returns ErrLocked if another process already holds it.
Click to show internal directories.
Click to hide internal directories.