types

package
Version: v0.0.0-...-6bec315 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package for shared data types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDomain

func ValidateDomain(domain string) bool

Types

type DomainT

type DomainT string

func ToDomain

func ToDomain(addr string) DomainT

func (DomainT) AsString

func (dom DomainT) AsString() string

func (DomainT) IsValid

func (dom DomainT) IsValid() bool

func (*DomainT) Set

func (dom *DomainT) Set(data string) error

type MAddress

type MAddress struct {
	IDType uint8
	ID     string
	Domain DomainT
}

For when a Mensago address or a workspace address is acceptable

func ToMAddress

func ToMAddress(addr string) MAddress

func (MAddress) GetAddress

func (a MAddress) GetAddress() string

func (MAddress) GetDomain

func (a MAddress) GetDomain() string

func (MAddress) GetID

func (a MAddress) GetID() string

func (MAddress) IsValid

func (a MAddress) IsValid() bool

func (MAddress) IsWorkspace

func (a MAddress) IsWorkspace() bool

IsWorkspace returns true if the ID is a workspace ID, not a user ID

func (*MAddress) Set

func (a *MAddress) Set(addr string) error

type UUID

type UUID string

func ToUUID

func ToUUID(addr string) UUID

func (UUID) AsString

func (wid UUID) AsString() string

func (UUID) IsValid

func (wid UUID) IsValid() bool

func (*UUID) Set

func (wid *UUID) Set(data string) error

type UserID

type UserID string

func ToUserID

func ToUserID(addr string) UserID

func (UserID) AsString

func (uid UserID) AsString() string

func (UserID) IsValid

func (uid UserID) IsValid() bool

func (*UserID) Set

func (uid *UserID) Set(data string) error

type WAddress

type WAddress struct {
	ID     UUID
	Domain DomainT
}

For when you *must* have a workspace address

func ToWAddress

func ToWAddress(addr string) WAddress

func (WAddress) AsMAddress

func (a WAddress) AsMAddress() MAddress

func (WAddress) GetAddress

func (a WAddress) GetAddress() string

func (WAddress) GetDomain

func (a WAddress) GetDomain() string

func (WAddress) GetID

func (a WAddress) GetID() string

func (WAddress) IsValid

func (a WAddress) IsValid() bool

func (*WAddress) Set

func (a *WAddress) Set(addr string) error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL