flags

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UseLinks uint = 1 << iota
	ReturnPatchContent
	AddMetaCountList
	AllowClientID

	// AllowForeignKeyFilter is the flag that allows filtering over foreign keys
	AllowForeignKeyFilter

	// UseFilterValueLimit is the flag that checks if there is any limit for the filter values
	UseFilterValueLimit

	// AllowStringSearch is a flag that defines if the string field may be filtered using
	// operators like: '$contains', '$startswith', '$endswith'
	AllowStringSearch
)

Variables

This section is empty.

Functions

func GetFirst

func GetFirst(flag uint, containers ...*Container) (value, ok bool)

GetFirst the first flag value that exists in the provided containers.

Types

type Container

type Container uint64

Container is the container for any enum type flags. The stored flag can be

func New

func New() *Container

func (*Container) Copy

func (f *Container) Copy() *Container

Copy returns the new copy of the container

func (Container) Get

func (f Container) Get(flag uint) (value, ok bool)

Get returns the value and the boolean if the flag were already set.

func (Container) IsSet

func (f Container) IsSet(flag uint) (ok bool)

IsSet returns the boolean wether the value were already set.

func (*Container) Set

func (f *Container) Set(flag uint, value bool)

Set sets the provided flag value.

func (*Container) SetFirst

func (f *Container) SetFirst(flag uint, containers ...*Container) (found bool)

SetFirst if any of the provided flag containers has a value for provided flag then the first one in the order will be written. Otherwise nothing happens

func (*Container) SetFrom

func (f *Container) SetFrom(flag uint, root *Container) (found bool)

SetFrom sets the flag value from the 'root' Container. If the value was not set within the root container, the value would in 'f' container would not be set.

func (Container) Value

func (f Container) Value(flag uint) (value bool)

Value returns the flag boolean value

Jump to

Keyboard shortcuts

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