logid

package
v0.0.0-...-113f59a Latest Latest
Warning

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

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

Documentation

Overview

Package logid contains ID types for interacting with the log service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateID

type PrivateID [32]byte

PrivateID represents a log steam for writing. Private IDs are only shared with the server when writing logs.

func NewPrivateID

func NewPrivateID() (id PrivateID, err error)

NewPrivateID generates a new random PrivateID. This should persist across runs of an instance of the application, so that it can append to the same log stream for each invocation.

func ParsePrivateID

func ParsePrivateID(in string) (out PrivateID, err error)

ParsePrivateID returns a PrivateID from its hex representation.

func (PrivateID) AppendText

func (id PrivateID) AppendText(b []byte) ([]byte, error)

func (PrivateID) IsZero

func (id PrivateID) IsZero() bool

func (PrivateID) MarshalText

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

func (PrivateID) Public

func (id PrivateID) Public() (pub PublicID)

Public returns the public ID of the private ID, which is the SHA-256 hash of the private ID.

func (PrivateID) String

func (id PrivateID) String() string

func (*PrivateID) UnmarshalText

func (id *PrivateID) UnmarshalText(in []byte) error

type PublicID

type PublicID [sha256.Size]byte

PublicID represents a log stream for reading. The PrivateID cannot be feasibly reversed from the PublicID.

func ParsePublicID

func ParsePublicID(in string) (out PublicID, err error)

ParsePublicID returns a PublicID from its hex representation.

func (PublicID) AppendText

func (id PublicID) AppendText(b []byte) ([]byte, error)

func (PublicID) Compare

func (id1 PublicID) Compare(id2 PublicID) int

func (PublicID) IsZero

func (id PublicID) IsZero() bool

func (PublicID) Less

func (id1 PublicID) Less(id2 PublicID) bool

func (PublicID) MarshalText

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

func (PublicID) Prefix64

func (id PublicID) Prefix64() uint64

func (PublicID) String

func (id PublicID) String() string

func (*PublicID) UnmarshalText

func (id *PublicID) UnmarshalText(in []byte) error

Jump to

Keyboard shortcuts

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