core

package
v0.0.0-...-8027ee6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const DomainFilelock = "D.lock"
View Source
const UsersFilename = "U"
View Source
const UsersFilesign = "U.sign"

Variables

View Source
var ClockOffset time.Duration
View Source
var ErrInvalidChangeFilePath = fmt.Errorf("a change file is not in a valid Safepool folder")
View Source
var ErrInvalidFilePath = fmt.Errorf("a file is not in a valid Safepool folder")
View Source
var ErrInvalidId = fmt.Errorf("the id is invalid")
View Source
var ErrInvalidSignature = fmt.Errorf("signature does not match the user id")
View Source
var ErrInvalidSize = fmt.Errorf("provided slice has not enough data")
View Source
var ErrInvalidVersion = fmt.Errorf("version of protocol is not compatible")
View Source
var ErrNoDriver = fmt.Errorf("no driver found for the provided configuration")
View Source
var ErrNoExchange = fmt.Errorf("no exchange reachable for the domain")
View Source
var ErrNotAuthorized = fmt.Errorf("user is not authorized in the domain")
View Source
var ErrNotInitialized = fmt.Errorf("safepool not initialized")
View Source
var MaxRecentErrors = 4096
View Source
var MaxStacktraceOut = 5
View Source
var NtpRetries = 10
View Source
var NtpServers = []string{
	"time.google.com",
	"0.beevik-ntp.pool.ntp.org",
}
View Source
var RecentLog []string
View Source
var SnowFlakeStart = time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)

Functions

func Debug

func Debug(format string, args ...any)

func FatalIf

func FatalIf(err error, msg string, args ...interface{})

func If

func If[T any](cond bool, whenTrue T, whenFalse T) T

func Info

func Info(format string, args ...any)

func IsErr

func IsErr(err error, msg string, args ...interface{}) bool

func NewBytesReader

func NewBytesReader(bs []byte) io.ReadSeekCloser

func NewStringReader

func NewStringReader(s string) io.ReadSeekCloser

func Now

func Now() time.Time

func ReadBytes

func ReadBytes(r io.Reader) ([]byte, error)

func Since

func Since(t time.Time) time.Duration

func TimeIsSync

func TimeIsSync() bool

func WriteBytes

func WriteBytes(data []byte, w io.Writer) error

Types

type BytesReader

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

func (BytesReader) Close

func (r BytesReader) Close() error

func (BytesReader) Read

func (r BytesReader) Read(p []byte) (n int, err error)

func (BytesReader) Seek

func (r BytesReader) Seek(offset int64, whence int) (int64, error)

func (BytesReader) WriteTo

func (r BytesReader) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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