enums

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotificationUndefined Notification     = 0               // undefined-notification
	NotificationBegin                      = 1 << (iota - 1) // begin-notification
	NotificationEnd                                          // end-notification
	NotificationDescend                                      // descend-notification
	NotificationAscend                                       // ascend-notification
	NotificationWake                                         // wake-notification
	NotificationSleep                                        // sleep-notification
	NotificationAll       = math.MaxUint32                   // all-notification
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryType

type EntryType uint

EntryType used to enable selecting directory entry type.

const (
	// EntryTypeDirectory
	//
	EntryTypeDirectory EntryType = iota // directory-entry

	// EntryTypeFile
	//
	EntryTypeFile // file-entry

	// EntryTypeAll
	//
	EntryTypeAll // all-entries
)

func (EntryType) String

func (i EntryType) String() string

type FilterScope

type FilterScope uint32

FilterScope allows client to define which node types should be filtered. Filters can be applied to multiple node types by bitwise or-ing the XXXNodes definitions. A node may have multiple scope designations, eg a node may be top level and leaf if the top level directory does not itself contain further sub-directories thereby making it also a leaf. It should be noted a file is only a leaf node all of its siblings are all files only

const (
	ScopeUndefined FilterScope = 0 // undefined-scope

	// ScopeTree, the Tree scope
	//
	ScopeTree FilterScope = 1 << (iota - 1) // tree-scope

	// ScopeTop, any node that is a direct descendent of the tree node
	//
	ScopeTop // top-scope

	// ScopeLeaf, for directories, any node that has no sub directories. For
	// files, any node that appears under a leaf directory node
	//
	ScopeLeaf // leaf-scope

	// ScopeIntermediate, apply filter to nodes which are neither leaf or top nodes
	//
	ScopeIntermediate // intermediate-scope

	// ScopeFile attributed to file nodes
	//
	ScopeFile // file-scope

	// ScopeDirectory attributed to directory nodes
	//
	ScopeDirectory // directory-scope

	// ScopeCustom, client defined categorisation (yet to be confirmed)
	//
	ScopeCustom // custom-scope

	// ScopeAll represents any node type
	//
	ScopeAll = math.MaxUint32 // all-scopes
)

func (*FilterScope) Clear

func (f *FilterScope) Clear(mask FilterScope)

Clear clears the bit position indicated by mask

func (*FilterScope) IsDirectory

func (f *FilterScope) IsDirectory() bool

IsDirectory check is the directory bit is set

func (*FilterScope) IsFile

func (f *FilterScope) IsFile() bool

IsFile check is the file bit is set

func (*FilterScope) IsTree

func (f *FilterScope) IsTree() bool

IsTree check is the tree bit is set

func (*FilterScope) Scrub

func (f *FilterScope) Scrub() FilterScope

Scrub ensures only file/directory scopes are set

func (*FilterScope) Set

func (f *FilterScope) Set(mask FilterScope)

Set sets the bit position indicated by mask

func (FilterScope) String

func (i FilterScope) String() string

type FilterType

type FilterType uint
const (
	FilterTypeUndefined FilterType = iota // undefined-filter

	// FilterTypeGlobEx is the preferred filter type as it the most
	// user friendly. The base part of the name is filtered by a glob
	// and the suffix is filtered by a list of defined extensions. The pattern
	// for the extended filter type is composed of 2 parts; the first is a
	// glob, which is applied to the base part of the name. The second part
	// is a csv of required extensions to filter for. The pattern is specified
	// in the form: "<base-glob>|ext1,ext2...". Each extension may include a
	// a leading dot. An example pattern definition would be:
	// "cover.*|.jpg,jpeg"
	//
	FilterTypeGlobEx // glob-ex-filter

	// FilterTypeRegex regex filter
	//
	FilterTypeRegex // regex-filter

	// FilterTypeGlob glob filter
	//
	FilterTypeGlob // glob-filter

	// FilterTypeCustom client definable filter
	//
	FilterTypeCustom // custom-filter

	// FilterTypePoly poly filter
	//
	FilterTypePoly // poly-filter
)

func (FilterType) String

func (i FilterType) String() string

type Hibernation

type Hibernation uint

Hibernation denotes whether user defined callback is being invoked.

const (
	HibernationUndefined Hibernation = iota // undefined

	// HibernationPending conditional listening is awaiting activation
	//
	HibernationPending // pending-hibernation

	// HibernationActive conditional listening is active (callback is invoked)
	//
	HibernationActive // active-hibernation

	// HibernationRetired conditional listening is now deactivated
	//
	HibernationRetired // retired-hibernation
)

func (Hibernation) String

func (i Hibernation) String() string

type InternalRole

type InternalRole uint

InternalRole represents the role of an application entity (like a plugin role) The key element of a role is that there should be just a single entity that can take up the role which is bound to a service.

For example, there can only be 1 logger. which means there can only be 1 entity that claims to provide this service, typically when the client invoke WithLogger option. This is similar to plugin architectures that allows plugins to register to provide a particular service.

The mediator knows about Roles and manage registration requests

const (
	InternalRoleRoleUndefined InternalRole = iota // undefined-role
	InternalRoleLogger                            // logger-role
	InternalRoleSampler                           // sampler-role
	InternalRoleResume                            // resume-role
)

func (InternalRole) String

func (i InternalRole) String() string

type Metric

type Metric uint
const (

	// MetricNoFilesInvoked represents the no of files invoked for during traversal
	//
	MetricNoFilesInvoked Metric // metric-no-of-files

	// MetricNoFilesFilteredOut represents the no of files filtered out
	//
	MetricNoFilesFilteredOut // metric-no-of-files-filtered-out

	// MetricNoDirectoriesInvoked represents the no of directories invoked for during traversal
	//
	MetricNoDirectoriesInvoked // metric-no-of-directories

	// MetricNoDirectoriesFilteredOut represents the no of directories filtered out
	//
	MetricNoDirectoriesFilteredOut // metric-no-of-directories-filtered-out

	// MetricNoChildFilesFound represents the number of children files
	// of a particular directory that pass the compound filter when using the directories
	// with files subscription
	//
	MetricNoChildFilesFound // metric-no-of-child-files-found

	// MetricNoChildFilesFilteredOut represents the number of children files
	// of a particular directory that fail to pass the compound filter when using
	// the directories with files subscription
	//
	MetricNoChildFilesFilteredOut // metric-no-of-child-files-found
)

if new metrics are added, ensure that navigationMetricsFactory.new is kept in sync.

func (Metric) String

func (i Metric) String() string

type Notification

type Notification uint32

func (Notification) String

func (i Notification) String() string

type PersistenceFormat

type PersistenceFormat uint
const (
	PersistUndefined PersistenceFormat = iota // persistence-undefined
	PersistJSON                               // persist-json
)

func (PersistenceFormat) String

func (i PersistenceFormat) String() string

type ResumeStrategy

type ResumeStrategy uint
const (
	ResumeStrategyUndefined ResumeStrategy = iota // undefined-resume-strategy
	ResumeStrategySpawn                           // spawn-resume-strategy
	ResumeStrategyFastward                        // fastward-resume-strategy
)

func (ResumeStrategy) String

func (i ResumeStrategy) String() string

type Role

type Role uint32
const (
	RoleUndefined    Role = iota // undefined-role
	RoleAnchor                   // anchor-role
	RoleClientFilter             // client-filter-role
	RoleHibernate                // hibernate-role
	RoleSampler                  // sampler-role
	RoleNanny                    // nanny-role
	RoleFastward                 // fastward-role
)

func (Role) String

func (i Role) String() string

type SampleType

type SampleType uint

SampleType determines the type of sampling to use

const (
	SampleTypeUndefined SampleType = iota // undefined-sample
	SampleTypeSlice                       // slice-sample
	SampleTypeFilter                      // filter-sample
	SampleTypeCustom                      // custom-sample
)

func (SampleType) String

func (i SampleType) String() string

type SkipTraversal

type SkipTraversal uint
const (
	SkipNoneTraversal SkipTraversal = iota // skip-none
	SkipDirTraversal                       // skip-dir
	SkipAllTraversal                       // skip-all
)

func (SkipTraversal) String

func (i SkipTraversal) String() string

type Subscription

type Subscription uint

Subscription type to define traversal subscription (for which file system items the client defined callback are invoked for).

const (
	SubscribeUndefined            Subscription = iota
	SubscribeFiles                             // subscribe-files
	SubscribeDirectories                       // subscribe-directories
	SubscribeDirectoriesWithFiles              // subscribe-directories-with-files
	SubscribeUniversal                         // subscribe-to-everything
)

func (Subscription) String

func (i Subscription) String() string

type TriStateBool

type TriStateBool uint
const (
	TriStateBoolUndefined TriStateBool = iota // undefined-bool
	TriStateBoolTrue                          // true
	TriStateBoolFalse                         // false
)

func (TriStateBool) String

func (i TriStateBool) String() string

type WayPoint

type WayPoint uint
const (
	WayPointUndefined WayPoint = iota // undefined-way-point
	WayPointWake                      // wake-from-hibernation
	WayPointSleep                     // sleep
	WayPointToggle                    // toggle-way-point
)

func (WayPoint) String

func (i WayPoint) String() string

Jump to

Keyboard shortcuts

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