attr

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// on a peer, local and peer supplied data
	LocalScope        = Scope("local")
	PeerScope         = Scope("peer")
	ConversationScope = Scope("conversation")

	// on a local profile, public data and private settings
	PublicScope = Scope("public")

	UnknownScope = Scope("unknown")
)

scopes for attributes

View Source
const (

	// ProfileZone for attributes related to profile details like name and profile image
	ProfileZone = Zone("profile")

	// FilesharingZone for attributes related to file sharing
	FilesharingZone = Zone("filesharing")

	// UnknownZone is a catch all useful for error handling
	UnknownZone = Zone("unknown")
)
View Source
const Separator = "."

Separator for scope and the rest of path

Variables

This section is empty.

Functions

func GetLocalScope

func GetLocalScope(path string) string

GetLocalScope takes a path and attaches the local scope to it Deprecated: Use ConstructScopedZonedPath

func GetPeerScope

func GetPeerScope(path string) string

GetPeerScope takes a path and attaches the peer scope to it Deprecated: Use ConstructScopedZonedPath

func GetPublicScope

func GetPublicScope(path string) string

GetPublicScope takes a path and attaches the local scope to it Deprecated: Use ConstructScopedZonedPath

Types

type Scope added in v0.12.0

type Scope string

Scope strongly types Scope strings

func IntoScope added in v0.12.0

func IntoScope(scope string) Scope

IntoScope converts a string to a Scope

func (Scope) ConstructScopedZonedPath added in v0.12.0

func (scope Scope) ConstructScopedZonedPath(zonedPath ZonedPath) ScopedZonedPath

ConstructScopedZonedPath enforces a scope over a zoned path

func (Scope) IsConversation added in v0.12.0

func (scope Scope) IsConversation() bool

IsConversation returns true if the scope is a conversation scope

func (Scope) IsLocal added in v0.12.0

func (scope Scope) IsLocal() bool

IsLocal returns true if the scope is a local scope

func (Scope) IsPeer added in v0.12.0

func (scope Scope) IsPeer() bool

IsPeer returns true if the scope is a peer scope

func (Scope) IsPublic added in v0.12.0

func (scope Scope) IsPublic() bool

IsPublic returns true if the scope is a public scope

type ScopedZonedPath added in v0.12.0

type ScopedZonedPath string

ScopedZonedPath typed path with a scope and a zone

func (ScopedZonedPath) ToString added in v0.12.0

func (szp ScopedZonedPath) ToString() string

ToString converts a ScopedZonedPath to a string

type Zone added in v0.12.0

type Zone string

Zone forces attributes to belong to a given subsystem e.g profile or filesharing Note: Zone is different from Scope which deals with public visibility of a given attribute

func ParseZone added in v0.12.0

func ParseZone(path string) (Zone, string)

ParseZone takes in an untyped string and returns an explicit Zone along with the rest of the untyped path

func (Zone) ConstructZonedPath added in v0.12.0

func (zone Zone) ConstructZonedPath(path string) ZonedPath

ConstructZonedPath takes a path and attaches a zone to it. Note that this returns a ZonedPath which isn't directly usable, it must be given to ConstructScopedZonedPath in order to be realized into an actual attribute path.

type ZonedPath added in v0.12.0

type ZonedPath string

ZonedPath explicitly types paths that contain a zone for strongly typed APIs

Jump to

Keyboard shortcuts

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