Documentation
¶
Index ¶
- Constants
- func ForkDaemon(cmd *exec.Cmd) (retErr error)
- func IsDaemon() bool
- func NewCASFS(opt *CASFSMountOpts) *casfs
- func WaitForFile(fileName string, timeout time.Duration) error
- func WaitForHash(dir string) error
- type CASFSMountOpts
- type Daemon
- type SelfStoppingServer
- type SnapshotService
- func (c *SnapshotService) AddGitRepo(workDir string, repo binding.GitRepo)
- func (c *SnapshotService) GetGitRepo(workDir string) (binding.GitRepo, bool)
- func (c *SnapshotService) GetMountDetails() *binding.MountDetails
- func (c *SnapshotService) Restore(ctx context.Context, snapshot binding.Snapshot) error
- func (c *SnapshotService) RestoreIndex(ctx context.Context, indexSnapHash entities.Hash, gitRepo *gitRepo) error
- func (c *SnapshotService) SnapIndex(ctx context.Context, gitRepo *gitRepo) (entities.Hash, error)
- func (c *SnapshotService) Snapshot(ctx context.Context) (binding.Snapshot, error)
Constants ¶
const ( ABFSDaemonEnvVar = "ABFS_DAEMON" ABFSWSMountDaemonEnvVar = "ABFS_WS_MOUNT_DAEMON" ABFSSyncPipeEnvVar = "ABFS_SYNC_PIPE_FD" )
const (
MountDetailsFileName = ".abfs.mount-details"
)
Variables ¶
This section is empty.
Functions ¶
func ForkDaemon ¶
ForkDaemon runs the given command in daemon mode. It means it spawns it in a separate process group and captures its stdout and stderr and writes them to this process stdout and stderr. But as soon as the daemon process closes its stderr and stdout, this process will assume the daemon is successfully detached and this process exits. If the daemon finishes its execution (say because of some errors), before it detaches this process will exit with the same error. It also relays signals it receives to the daemon process.
func IsDaemon ¶
func IsDaemon() bool
IsDaemon returns true if the current process is running as a daemon.
func NewCASFS ¶
func NewCASFS(opt *CASFSMountOpts) *casfs
func WaitForFile ¶
Wait for file at path to exist until specified timeout
func WaitForHash ¶
Wait for hash attribute available on given directory
Types ¶
type CASFSMountOpts ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func SetupDaemon ¶
SetupDaemon sets up this process as a daemon, it will tee the stdout and stderr to the provided log file as well is the process original stdout and stderr. When Switch() is called it closes the original stdout and stderr and replaces them with log file only.
type SelfStoppingServer ¶
type SelfStoppingServer struct {
http.Server
SocketPath string
Done chan struct{}
// contains filtered or unexported fields
}
func (*SelfStoppingServer) Shutdown ¶
func (s *SelfStoppingServer) Shutdown(ctx context.Context) error
func (*SelfStoppingServer) WatchSocket ¶
func (s *SelfStoppingServer) WatchSocket(ctx context.Context) (retErr error)
type SnapshotService ¶
type SnapshotService struct {
// contains filtered or unexported fields
}
func NewSnapshotService ¶
func NewSnapshotService(casfs *casfs) *SnapshotService
func (*SnapshotService) AddGitRepo ¶
func (c *SnapshotService) AddGitRepo(workDir string, repo binding.GitRepo)
func (*SnapshotService) GetGitRepo ¶
func (c *SnapshotService) GetGitRepo(workDir string) (binding.GitRepo, bool)
func (*SnapshotService) GetMountDetails ¶
func (c *SnapshotService) GetMountDetails() *binding.MountDetails