attr

package
v0.18.9 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 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")

	// LegacyGroupZone for attributes related to legacy group experiment
	LegacyGroupZone = Zone("legacygroup")

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

	// ServerKeyZone for attributes related to Server Keys
	ServerKeyZone = Zone("serverkey")

	// ServerZone is for attributes related to the server
	ServerZone = Zone("server")

	// 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

This section is empty.

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 ParseScope added in v0.16.4

func ParseScope(path string) (Scope, string)

ParseScope takes in an untyped string and returns an explicit Scope along with the rest of the untyped path

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

func (ZonedPath) ToString added in v0.18.9

func (zp ZonedPath) ToString() string

Jump to

Keyboard shortcuts

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