basic

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OpGetRangeHash is an index of GetRangeHash operation in basic ACL bitmask order.
	OpGetRangeHash uint8 = iota

	// OpGetRange is an index of GetRange operation in basic ACL bitmask order.
	OpGetRange

	// OpSearch is an index of Search operation in basic ACL bitmask order.
	OpSearch

	// OpDelete is an index of Delete operation in basic ACL bitmask order.
	OpDelete

	// OpPut is an index of Put operation in basic ACL bitmask order.
	OpPut

	// OpHead is an index of Head operation in basic ACL bitmask order.
	OpHead

	// OpGet is an index of Get operation in basic ACL bitmask order.
	OpGet
)
View Source
const Size = 4

Size is a size of ACL in a binary form.

Variables

This section is empty.

Functions

func Equal

func Equal(a, b ACL) bool

Equal reports whether e and e2 are the same ACL.

Function defines the relation of equality between two ACL. Try to avoid comparison through "==" operator for better portability.

func Marshal

func Marshal(a ACL) []byte

Marshal encodes ACL into a binary form and returns the result.

Result slice has Size length.

func ToUint32

func ToUint32(v ACL) uint32

ToUint32 converts ACL value to builtin uint32.

Try to avoid direct cast for better portability.

Types

type ACL

type ACL uint32

ACL represents a container's basic permission bits.

func FromUint32

func FromUint32(v uint32) ACL

FromUint32 converts builtin uint32 value to ACL.

Try to avoid direct cast for better portability.

func (*ACL) AllowBearer

func (a *ACL) AllowBearer(op uint8)

AllowBearer allows Bearer token usage for n-th operation in basic ACL.

func (*ACL) AllowOthers

func (a *ACL) AllowOthers(op uint8)

AllowOthers allows Others group the n-th operation in basic ACL.

func (*ACL) AllowSystem

func (a *ACL) AllowSystem(op uint8)

AllowSystem allows System group the n-th operation in basic ACL.

func (*ACL) AllowUser

func (a *ACL) AllowUser(n uint8)

AllowUser allows user the n-th operation in basic ACL.

func (ACL) BearerAllowed

func (a ACL) BearerAllowed(op uint8) bool

BearerAllowed returns true if Bearer token usage is allowed for n-th operation in basic ACL.

func (ACL) Final

func (a ACL) Final() bool

Final returns true if final option is enabled in basic ACL.

func (*ACL) ForbidBearer

func (a *ACL) ForbidBearer(op uint8)

ForbidBearer forbids Bearer token usage for n-th operation in basic ACL.

func (*ACL) ForbidOthers

func (a *ACL) ForbidOthers(op uint8)

ForbidOthers forbids Others group the n-th operation in basic ACL.

func (*ACL) ForbidSystem

func (a *ACL) ForbidSystem(op uint8)

ForbidSystem forbids System group the n-th operation in basic ACL.

func (*ACL) ForbidUser

func (a *ACL) ForbidUser(n uint8)

ForbidUser forbids user the n-th operation in basic ACL.

func (ACL) OthersAllowed

func (a ACL) OthersAllowed(op uint8) bool

OthersAllowed returns true if Others group allowed the n-th operation is set in basic ACL.

func (ACL) Reserved

func (a ACL) Reserved(n uint8) bool

Reserved returns true if n-th reserved option is enabled in basic ACL.

func (*ACL) ResetFinal

func (a *ACL) ResetFinal()

ResetFinal disables final option in basic ACL.

func (*ACL) ResetReserved

func (a *ACL) ResetReserved(bit uint8)

ResetReserved disables the n-th reserved option in basic ACL.

func (*ACL) ResetSticky

func (a *ACL) ResetSticky()

ResetSticky disables the sticky option in basic ACL.

func (*ACL) SetFinal

func (a *ACL) SetFinal()

SetFinal enables final option in basic ACL.

func (*ACL) SetReserved

func (a *ACL) SetReserved(bit uint8)

SetReserved enables the n-th reserved option in basic ACL.

func (*ACL) SetSticky

func (a *ACL) SetSticky()

SetSticky enables the sticky option in basic ACL.

func (ACL) Sticky

func (a ACL) Sticky() bool

Sticky returns true if sticky option is enabled in basic ACL.

func (ACL) SystemAllowed

func (a ACL) SystemAllowed(n uint8) bool

SystemAllowed returns true if System group allowed the n-th operation is set in basic ACL.

func (*ACL) UnmarshalBinary

func (a *ACL) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshals ACL from a binary representation.

If buffer size is insufficient, io.ErrUnexpectedEOF is returned.

func (ACL) UserAllowed

func (a ACL) UserAllowed(n uint8) bool

UserAllowed returns true if user allowed the n-th operation in basic ACL.

Jump to

Keyboard shortcuts

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