sub

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 60

Documentation

Index

Constants

View Source
const (
	DisruptionStateAnytime   = 0 // Not implemented or configured.
	DisruptionStatePermitted = 1
	DisruptionStateRequested = 2
	DisruptionStateDenied    = 3

	ErrorDisruptionPending = "disruption pending"
	ErrorDisruptionDenied  = "disruption denied"
)

Variables

This section is empty.

Functions

func VerifyDisruptionState added in v0.3.2

func VerifyDisruptionState(state DisruptionState) bool

Types

type BoostCpuLimitRequest

type BoostCpuLimitRequest struct{}

type BoostCpuLimitResponse

type BoostCpuLimitResponse struct{}

type CleanupRequest

type CleanupRequest struct {
	Hashes []hash.Hash
}

type CleanupResponse

type CleanupResponse struct{}

type Configuration

type Configuration struct {
	CpuPercent          uint
	OwnerGroups         []string
	OwnerUsers          []string
	NetworkSpeedPercent uint
	ScanSpeedPercent    uint
	ScanExclusionList   []string
}

func (Configuration) String

func (configuration Configuration) String() string

type DisruptionState added in v0.3.2

type DisruptionState uint

func (DisruptionState) MarshalText added in v0.3.2

func (state DisruptionState) MarshalText() (text []byte, err error)

func (DisruptionState) String added in v0.3.2

func (state DisruptionState) String() string

func (*DisruptionState) UnmarshalText added in v0.3.2

func (state *DisruptionState) UnmarshalText(text []byte) error

type FetchRequest

type FetchRequest struct {
	LockFor       time.Duration // Duration to lock other clients from mutating.
	ServerAddress string
	Wait          bool
	Hashes        []hash.Hash
}

type FetchResponse

type FetchResponse struct {
	LockedUntil time.Time
}

type FileToCopyToCache

type FileToCopyToCache struct {
	Name       string
	Hash       hash.Hash
	DoHardlink bool
}

type GetConfigurationRequest

type GetConfigurationRequest struct{}

type GetConfigurationResponse

type GetConfigurationResponse Configuration

func (GetConfigurationResponse) String

func (configuration GetConfigurationResponse) String() string

type GetFileResponse

type GetFileResponse struct {
	Error string
	Size  uint64

} // File data are streamed afterwards.
type Hardlink struct {
	NewLink string
	Target  string
}

type Inode

type Inode struct {
	Name string
	filesystem.GenericInode
}

type PollRequest

type PollRequest struct {
	HaveGeneration uint64
	LockFor        time.Duration
	ShortPollOnly  bool // If true, do not send FileSystem or ObjectCache.
}

type PollResponse

type PollResponse struct {
	NetworkSpeed                 uint64 // Capacity of the network interface.
	CurrentConfiguration         Configuration
	FetchInProgress              bool // Fetch() and Update() mutually exclusive
	UpdateInProgress             bool
	LastFetchError               string
	LastNote                     string // Updated after successful Update().
	LastSuccessfulImageName      string
	LastUpdateError              string
	LastUpdateHadTriggerFailures bool
	LastWriteError               string
	LockedByAnotherClient        bool // Fetch() and Update() restricted.
	LockedUntil                  time.Time
	FreeSpace                    *uint64
	StartTime                    time.Time
	PollTime                     time.Time
	ScanCount                    uint64
	DurationOfLastScan           time.Duration
	GenerationCount              uint64
	SystemUptime                 *time.Duration
	DisruptionState              DisruptionState
	FileSystemFollows            bool
	FileSystem                   *filesystem.FileSystem  // Streamed separately.
	ObjectCache                  objectcache.ObjectCache // Streamed separately.

} // FileSystem is encoded afterwards, followed by ObjectCache.

type SetConfigurationRequest

type SetConfigurationRequest Configuration

type SetConfigurationResponse

type SetConfigurationResponse struct{}

type UpdateRequest

type UpdateRequest struct {
	ForceDisruption bool
	ImageName       string
	Wait            bool
	// The ordering here reflects the ordering that the sub is expected to use.
	FilesToCopyToCache  []FileToCopyToCache
	DirectoriesToMake   []Inode
	InodesToMake        []Inode
	HardlinksToMake     []Hardlink
	PathsToDelete       []string
	InodesToChange      []Inode
	MultiplyUsedObjects map[hash.Hash]uint64
	Triggers            *triggers.Triggers
}

type UpdateResponse

type UpdateResponse struct{}

Jump to

Keyboard shortcuts

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