hiddenpath

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrInvalidGroupIdFormat indicates an invalid GroupId format
	ErrInvalidGroupIdFormat common.ErrMsg = "Invalid GroupId format"
	// ErrInvalidGroupIdSuffix indicates an invalid GroupId suffix
	ErrInvalidGroupIdSuffix common.ErrMsg = "Invalid GroupId suffix"
)

Parsing errors

View Source
const (
	// ErrMissingGroupId indicates a missing GroupId
	ErrMissingGroupId common.ErrMsg = "Missing GroupId"
	// ErrInvalidVersion indicates a missing version
	ErrInvalidVersion common.ErrMsg = "Invalid version"
	// ErrMissingOwner indicates a missing Owner
	ErrMissingOwner common.ErrMsg = "Missing Owner"
	// ErrOwnerMismatch indicates a mismatch between Owner and GroupId.OwnerAS
	ErrOwnerMismatch common.ErrMsg = "Owner mismatch"
	// ErrEmptyWriters indicates an empty Writer section
	ErrEmptyWriters common.ErrMsg = "Writer section cannot be empty"
	// ErrEmptyRegistries indicates an empty Registires section
	ErrEmptyRegistries common.ErrMsg = "Registry section cannot be empty"
)

Validation errors

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Id         GroupId `json:"GroupID"`
	Version    uint
	Owner      addr.IA
	Writers    []addr.IA
	Readers    []addr.IA
	Registries []addr.IA
}

func GroupFromMsg

func GroupFromMsg(m *path_mgmt.HPCfg) *Group

GroupFromMsg returns a HPCfg from the Cerializable representation

func (*Group) HasReader

func (g *Group) HasReader(ia addr.IA) bool

HasReader returns true if ia is a Reader of h

func (*Group) HasRegistry

func (g *Group) HasRegistry(ia addr.IA) bool

HasRegistry returns true if ia is a Registry of h

func (*Group) HasWriter

func (g *Group) HasWriter(ia addr.IA) bool

HasWriter returns true if ia is a Writer of h

func (*Group) ToMsg

func (g *Group) ToMsg() *path_mgmt.HPCfg

ToMsg returns h as Cerializable message suitable to be sent via messenger

func (*Group) UnmarshalJSON

func (g *Group) UnmarshalJSON(data []byte) (err error)

type GroupId

type GroupId struct {
	OwnerAS addr.AS
	Suffix  uint16
}

func IdFromMsg

func IdFromMsg(id *path_mgmt.HPGroupId) GroupId

IdFromMsg returns a GroupId from the Cerializable representation

func (GroupId) MarshalJSON

func (id GroupId) MarshalJSON() ([]byte, error)

func (GroupId) MarshalText

func (id GroupId) MarshalText() ([]byte, error)

func (GroupId) String

func (id GroupId) String() string

func (GroupId) ToMsg

func (id GroupId) ToMsg() *path_mgmt.HPGroupId

ToMsg returns id as Cerializable message suitable to be sent via messenger

func (*GroupId) UnmarshalJSON

func (id *GroupId) UnmarshalJSON(data []byte) (err error)

func (*GroupId) UnmarshalText

func (id *GroupId) UnmarshalText(data []byte) error

type GroupIdSet

type GroupIdSet map[GroupId]struct{}

GroupIdSet is a set of hidden path GroupIds

func GroupIdsToSet

func GroupIdsToSet(ids ...GroupId) GroupIdSet

GroupIdsToSet converts a list of GroupIds to a GroupIdSet, ensuring no duplcates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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