common

package
v0.0.0-...-7853e9f Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDatetime

func ParseDatetime(datetimeStr string) *time.Time

Types

type AtKey

type AtKey interface {
	GetNamespace() string
	SetNamespace(namespace string) AtKey
	GetFullyQualifiedKeyName() string
	SetName(name string) AtKey
	GetName() string
	SetTimeToLive(ttl int) AtKey
	SetTimeToBirth(ttb int) AtKey
	String() string
	GetMetadata() *Metadata
	SetMetadata(m Metadata) AtKey
	GetSharedBy() *AtSign
	GetSharedWith() *AtSign
}

func KeysFromString

func KeysFromString(fullAtKeyName string) (AtKey, error)

type AtKeyBase

type AtKeyBase struct {
	Name       string
	SharedBy   *AtSign
	SharedWith *AtSign
	Namespace  string
	Metadata   Metadata
}

func (*AtKeyBase) GetFullyQualifiedKeyName

func (a *AtKeyBase) GetFullyQualifiedKeyName() string

func (*AtKeyBase) GetMetadata

func (a *AtKeyBase) GetMetadata() *Metadata

func (*AtKeyBase) GetName

func (a *AtKeyBase) GetName() string

func (*AtKeyBase) GetNamespace

func (a *AtKeyBase) GetNamespace() string

func (*AtKeyBase) GetSharedBy

func (a *AtKeyBase) GetSharedBy() *AtSign

func (*AtKeyBase) GetSharedWith

func (a *AtKeyBase) GetSharedWith() *AtSign

func (*AtKeyBase) SetMetadata

func (a *AtKeyBase) SetMetadata(m Metadata) AtKey

func (*AtKeyBase) SetName

func (a *AtKeyBase) SetName(name string) AtKey

func (*AtKeyBase) SetNamespace

func (a *AtKeyBase) SetNamespace(namespace string) AtKey

func (*AtKeyBase) SetTimeToBirth

func (a *AtKeyBase) SetTimeToBirth(ttb int) AtKey

func (*AtKeyBase) SetTimeToLive

func (a *AtKeyBase) SetTimeToLive(ttl int) AtKey

func (*AtKeyBase) String

func (a *AtKeyBase) String() string

type AtSign

type AtSign struct {
	AtSignStr     string
	WithoutPrefix string
}

func NewAtSign

func NewAtSign(atSign string) *AtSign

type Keys

type Keys struct{}

func NewKeys

func NewKeys() *Keys

type Metadata

type Metadata struct {
	TTL             int        `json:"ttl"`
	TTB             int        `json:"ttb"`
	TTR             int        `json:"ttr"`
	CCD             bool       `json:"ccd"`
	CreatedBy       string     `json:"createdBy"`
	UpdatedBy       string     `json:"updatedBy"`
	AvailableAt     *time.Time `json:"availableAt,omitempty"`
	ExpiresAt       *time.Time `json:"expiresAt,omitempty"`
	RefreshAt       *time.Time `json:"refreshAt,omitempty"`
	CreatedAt       *time.Time `json:"createdAt,omitempty"`
	UpdatedAt       *time.Time `json:"updatedAt,omitempty"`
	Status          string     `json:"status,omitempty"`
	Version         int        `json:"version"`
	DataSignature   string     `json:"dataSignature,omitempty"`
	SharedKeyStatus string     `json:"sharedKeyStatus,omitempty"`
	IsPublic        bool       `json:"isPublic"`
	IsEncrypted     bool       `json:"isEncrypted"`
	IsHidden        bool       `json:"isHidden"`
	NamespaceAware  bool       `json:"namespaceAware"`
	IsBinary        bool       `json:"isBinary"`
	IsCached        bool       `json:"isCached"`
	SharedKeyEnc    string     `json:"sharedKeyEnc,omitempty"`
	PubKeyCS        string     `json:"pubKeyCS,omitempty"`
	Encoding        string     `json:"encoding,omitempty"`
	IVNonce         string     `json:"ivNonce,omitempty"`
}

func FromJSON

func FromJSON(jsonStr string) (*Metadata, error)

func Squash

func Squash(firstMetadata, secondMetadata *Metadata) *Metadata

func (*Metadata) String

func (metadata *Metadata) String() string

type PrivateHiddenKey

type PrivateHiddenKey struct {
	AtKeyBase
}

func NewPrivateHiddenKey

func NewPrivateHiddenKey(name string, sharedBy *AtSign) *PrivateHiddenKey

type PublicKey

type PublicKey struct {
	AtKeyBase
}

func NewPublicKey

func NewPublicKey(name string, sharedBy *AtSign) *PublicKey

func (*PublicKey) Cache

func (pk *PublicKey) Cache(ttr int, ccd bool) *PublicKey

type SelfKey

type SelfKey struct {
	AtKeyBase
	SharedWith *AtSign
}

func NewSelfKey

func NewSelfKey(name string, sharedBy *AtSign, sharedWith *AtSign) *SelfKey

type SharedKey

type SharedKey struct {
	AtKeyBase
	SharedWith *AtSign
}

func NewSharedKey

func NewSharedKey(name string, sharedBy *AtSign, sharedWith *AtSign) *SharedKey

func SharedKeyFromString

func SharedKeyFromString(key string) (*SharedKey, error)

func (*SharedKey) Cache

func (sk *SharedKey) Cache(ttr int, ccd bool) *SharedKey

func (*SharedKey) GetSharedSharedKeyName

func (sk *SharedKey) GetSharedSharedKeyName() string

Jump to

Keyboard shortcuts

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