Documentation ¶
Index ¶
- Constants
- Variables
- func Assert(t *testing.T, cond bool, msg string, args ...interface{})
- func Debug(format string, args ...any)
- func DecodeBinary(data string) ([]byte, error)
- func EncodeBinary(data []byte) string
- func ErrLike(err error, format string) bool
- func FatalIf(err error, msg string, args ...interface{})
- func GenerateRandomBytes(length int) []byte
- func If[T any](cond bool, whenTrue T, whenFalse T) T
- func Info(format string, args ...any)
- func IsErr(err error, format *string, msg string, args ...interface{}) bool
- func IsWarn(err error, msg string, args ...interface{}) bool
- func MatchOrigId(id uint64, orig uint64) bool
- func NewBytesReader(bs []byte) io.ReadSeekCloser
- func NewStringReader(s string) io.ReadSeekCloser
- func NextID(n uint64) uint64
- func Now() time.Time
- func ReadBytes(r io.Reader) ([]byte, error)
- func Since(t time.Time) time.Duration
- func TestErr(t *testing.T, err error, msg string, args ...interface{})
- func TimeFromID(id uint64) time.Time
- func TimeIsSync() bool
- func Trace(format string, args ...any)
- func WriteBytes(data []byte, w io.Writer) error
- type BytesReader
Constants ¶
View Source
const ( ReservedBit uint64 = 1 << 63 MaxTimestamp uint64 = 1<<41 - 1 MaxHash uint64 = 1<<16 - 1 MaxSequence uint64 = 1<<6 - 1 )
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 Woland folder")
View Source
var ErrInvalidFilePath = fmt.Errorf("a file is not in a valid Woland 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("woland 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 DecodeBinary ¶
func EncodeBinary ¶
func GenerateRandomBytes ¶
func MatchOrigId ¶
func NewBytesReader ¶
func NewBytesReader(bs []byte) io.ReadSeekCloser
func NewStringReader ¶
func NewStringReader(s string) io.ReadSeekCloser
func TimeFromID ¶
func TimeIsSync ¶
func TimeIsSync() bool
Types ¶
type BytesReader ¶
type BytesReader struct {
// contains filtered or unexported fields
}
func (BytesReader) Close ¶
func (r BytesReader) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.