service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(data []byte) (string, error)

func NameModel

func NameModel() (*ld.IPLDModel, error)

func ProfileModel

func ProfileModel() (*ld.IPLDModel, error)

Types

type DN

type DN struct {
	// contains filtered or unexported fields
}

Decentralized Name

func NewDN

func NewDN(name string) (*DN, error)

func (*DN) ASCII

func (d *DN) ASCII() string

ASCII returns the ASCII form of the DN

func (*DN) IsDomain

func (d *DN) IsDomain() bool

func (*DN) String

func (d *DN) String() string

String returns the Unicode form of the DN

type Extension

type Extension struct {
	Title      string         `cbor:"t" json:"title"` // extension title
	Properties map[string]any `cbor:"ps" json:"properties"`
	DataID     *ids.DataID    `cbor:"id,omitempty" json:"did,omitempty"` // optional data id
	ModelID    *ids.ModelID   `cbor:"m,omitempty" json:"mid,omitempty"`  // optional model id
}

type Extensions

type Extensions []*Extension

func (Extensions) SyntacticVerify

func (es Extensions) SyntacticVerify() error

SyntacticVerify verifies that Extensions is well-formed.

type Name

type Name struct {
	// name should be Unicode form
	Name string `cbor:"n" json:"name"`
	// optional, linked (ProfileService) data id
	Linked     *ids.DataID `cbor:"l,omitempty" json:"linked,omitempty"`
	Records    []string    `cbor:"rs" json:"records"` // DNS resource records
	Extensions Extensions  `cbor:"es" json:"extensions"`

	// external assignment fields
	DataID ids.DataID `cbor:"-" json:"did"`
	// contains filtered or unexported fields
}

func (*Name) ASCII

func (n *Name) ASCII() string

func (*Name) Bytes

func (n *Name) Bytes() []byte

func (*Name) Marshal

func (n *Name) Marshal() ([]byte, error)

func (*Name) SyntacticVerify

func (n *Name) SyntacticVerify() error

SyntacticVerify verifies that a *Name is well-formed.

func (*Name) Unmarshal

func (n *Name) Unmarshal(data []byte) error

type Profile

type Profile struct {
	Type  ProfileType `cbor:"t" json:"type"`        // Thing, Person, Organization...
	Name  string      `cbor:"n" json:"name"`        // Thing property
	Desc  string      `cbor:"d" json:"description"` // Thing property
	Image string      `cbor:"i" json:"image"`       // Thing property, relay url
	URL   string      `cbor:"u" json:"url"`         // Thing property, relay url
	// follow other ProfileService data id
	Follows ids.IDList[ids.DataID] `cbor:"fs" json:"follows"`
	// optional, other ProfileService data id
	Members    ids.IDList[ids.DataID] `cbor:"ms,omitempty" json:"members,omitempty"`
	Extensions Extensions             `cbor:"es" json:"extensions"`

	// external assignment fields
	DataID ids.DataID `cbor:"-" json:"did"`
	// contains filtered or unexported fields
}

https://schema.org/Thing

func (*Profile) Bytes

func (p *Profile) Bytes() []byte

func (*Profile) Marshal

func (p *Profile) Marshal() ([]byte, error)

func (*Profile) SyntacticVerify

func (p *Profile) SyntacticVerify() error

SyntacticVerify verifies that a *Profile is well-formed.

func (*Profile) Unmarshal

func (p *Profile) Unmarshal(data []byte) error

type ProfileType

type ProfileType uint16

func (ProfileType) MarshalJSON

func (pt ProfileType) MarshalJSON() ([]byte, error)

func (ProfileType) String

func (pt ProfileType) String() string

Jump to

Keyboard shortcuts

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