Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(format string, args ...any)
- func FatalIf(err error, msg string, args ...interface{})
- func If[T any](cond bool, whenTrue T, whenFalse T) T
- func Info(format string, args ...any)
- func IsErr(err error, msg string, args ...interface{}) bool
- func NewBytesReader(bs []byte) io.ReadSeekCloser
- func NewStringReader(s string) io.ReadSeekCloser
- func Now() time.Time
- func ReadBytes(r io.Reader) ([]byte, error)
- func Since(t time.Time) time.Duration
- func TimeIsSync() bool
- func WriteBytes(data []byte, w io.Writer) error
- type BytesReader
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 NewBytesReader ¶
func NewBytesReader(bs []byte) io.ReadSeekCloser
func NewStringReader ¶
func NewStringReader(s string) io.ReadSeekCloser
func TimeIsSync ¶
func TimeIsSync() bool
Types ¶
type BytesReader ¶
type BytesReader struct {
// contains filtered or unexported fields
}
func (BytesReader) Close ¶
func (r BytesReader) Close() error
Click to show internal directories.
Click to hide internal directories.