manager

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package manager is used to manage mounts in a bolt database, normally backed by a tempfs.

Database schema

v1
╘══*namespace*
   ├──mounts
   │  ╘══*mount name*
   │     ├──id : <varuint64>                  - Unique ID for mount (auto incrementing)
   │     ├──createdat : <binary time>         - Created at
   │     ├──updatedat : <binary time>         - Updated at
   │     ├──lease : <string>                  - Lease
   │     ├──active
   │     │  ╘══*order*
   │     │     ├──mountedat : <binary time>   - Mounted at
   │     │     ├──state : <enum>              - (0 - unmounted, 1 - filesystem, 2 - device, 3 - process)
   │     │     ├──type : <string>             - Mount type
   │     │     ├──source : <string>           - Mount source
   │     │     ├──target : <string>           - Mount target (relative to previous mount point)
   │     │     ├──mp : <string>               - Mount point for filesystem mount
   │     │     ├──mpg : <bool>                - Whether the mount point is auto generated (NOT USED)
   │     │     ├──dev : <string>              - Device active for this mount (NOT USED)
   │     │     ├──pid : <int>                 - Process created for this mount (NOT USED)
   │     │     └──options : <string>          - Comma separate options
   │     ├──system
   │     │  ╘══*order*
   │     │     ├──type : <string>             - Mount type
   │     │     ├──source : <string>           - Mount source
   │     │     ├──target : <string>           - Mount target (relative to previous mount point)
   │     │     └──options : <string>          - Comma separate options
   │     └──labels
   │        ╘══*key* : <string>               - Label value
   ├──leases
   │  ╘══*lease id*
   │     ╘══*mount name*: nil
   └──unmountq                                (CURRENTLY NOT USED, may remove)
      └──*mount name + auto-increment*
         ├──type : <string>                   - Mount type
         ├──target : <string>                 - Path to check && unmount
         ├──rm : <bool>                       - Whether to remove target after unmount
         ├──dev : <string>                    - Device to check before unmount
         ├──pid : <int>                       - Process to check and kill
         ├──target : <string>                 - Path to unmount
         ├──state : <enum>                    - (0 - unmounted, 1 - filesystem, 2 - device, 3 - process)
         └─ order : <int>                     - Order in which was mounted, unmount high to low

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(db *bolt.DB, targetDir string, opts ...Opt) (mount.Manager, error)

Types

type BoltManager

type BoltManager interface {
	mount.Manager
	metadata.Collector
	Sync(context.Context) error
}

type Opt

type Opt func(*managerOptions) error

func WithAllowedRoot

func WithAllowedRoot(root string) Opt

func WithMountHandler

func WithMountHandler(name string, h mount.Handler) Opt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL