aboutsummaryrefslogtreecommitdiff
path: root/pkg/mountmanager/types.go
blob: 37f791f65a6dc00cb50ed7d5158df63674ffa235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package mountmanager

// MountRequest contains all information needed to start a weed mount process.
type MountRequest struct {
	VolumeID          string            `json:"volumeId"`
	TargetPath        string            `json:"targetPath"`
	ReadOnly          bool              `json:"readOnly"`
	Filers            []string          `json:"filers"`
	CacheDir          string            `json:"cacheDir"`
	CacheCapacityMB   int               `json:"cacheCapacityMB"`
	ConcurrentWriters int               `json:"concurrentWriters"`
	UidMap            string            `json:"uidMap"`
	GidMap            string            `json:"gidMap"`
	DataCenter        string            `json:"dataCenter"`
	DataLocality      string            `json:"dataLocality"`
	VolumeContext     map[string]string `json:"volumeContext"`
}

// MountResponse is returned after a successful mount request.
type MountResponse struct {
	LocalSocket string `json:"localSocket"`
}

// UnmountRequest contains the information needed to stop a weed mount process.
type UnmountRequest struct {
	VolumeID string `json:"volumeId"`
}

// UnmountResponse is the response of a successful unmount request.
type UnmountResponse struct{}

// ConfigureRequest adjusts the behaviour of an existing mount.
type ConfigureRequest struct {
	VolumeID           string `json:"volumeId"`
	CollectionCapacity int64  `json:"collectionCapacity"`
}

// ConfigureResponse represents a successful configure call.
type ConfigureResponse struct{}

// ErrorResponse is returned when the mount service encounters a failure.
type ErrorResponse struct {
	Error string `json:"error"`
}

const (
	// DefaultWeedBinary is the default executable name used to spawn weed mount processes.
	DefaultWeedBinary = "weed"
)