Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorCode(err error) string
- func FormatLTXFilename(min, max ltx.TXID) string
- func IsApplicationError(err error) bool
- func ParseLTXFilename(name string) (min, max ltx.TXID, err error)
- func ValidateClusterName(s string) error
- func ValidateDatabase(s string) error
- type Config
- type Error
- type ErrorType
Constants ¶
View Source
const ( EPOSMISMATCH = "EPOSMISMATCH" ENOCLUSTER = "ENOCLUSTER" ENOCOMPACTION = "ENOCOMPACTION" EPARTIALCOMPACTION = "EPARTIALCOMPACTION" )
Common error codes. Used for compile-time checks.
View Source
const ( // CompactionLevelMax is the highest compaction level allowed. CompactionLevelMax = 8 // CompactionLevelSnapshot is a reserved level for full snapshots only. CompactionLevelSnapshot = 9 )
View Source
const ( MaxClusterLen = 32 MaxDatabaseLen = 256 )
Maximum identifier lengths.
View Source
const LTXFilenameLen = 16 + 1 + 16 + 4 // min,dash,max,ext
LTXFilenameLen is the length of LTX base filenames.
Variables ¶
View Source
var ( ErrInvalidLTXFilename = Errorf(ErrorTypeValidation, "EBADPATH", "invalid ltx filename") ErrClusterRequired = Errorf(ErrorTypeValidation, "EBADCLUSTER", "cluster required") ErrClusterInvalid = Errorf(ErrorTypeValidation, "EBADCLUSTER", "cluster invalid") ErrDatabaseRequired = Errorf(ErrorTypeValidation, "EBADDB", "database required") ErrDatabaseNotFound = Errorf(ErrorTypeNotFound, "ENODB", "database not found") ErrMinTXIDRequired = Errorf(ErrorTypeValidation, "EBADTXID", "minimum transaction id required") ErrMaxTXIDRequired = Errorf(ErrorTypeValidation, "EBADTXID", "maximum transaction id required") ErrCannotCompactToLevelZero = Errorf(ErrorTypeValidation, "EBADLEVEL", "cannot compact to level zero") ErrCompactionLevelTooHigh = Errorf(ErrorTypeValidation, "EBADLEVEL", "compaction level too high") ErrTxNotAvailable = Errorf(ErrorTypeNotFound, "ENOTXID", "tx not available") // ErrPgnoOutOfBounds = Errorf(ErrorTypeNotFound, "EPGNOOOB", "page number out of bounds") ErrPageNotFound = Errorf(ErrorTypeNotFound, "ENOPAGE", "page not found") ErrTimestampNotAvailable = Errorf(ErrorTypeNotFound, "ENOTIMESTAMP", "timestamp not available") ErrPageSizeMismatch = Errorf(ErrorTypeUnprocessable, "EBADHEADER", "page size mismatch") )
Functions ¶
func ErrorCode ¶
ErrorCode returns the error code from an error. Returns blank if err is nil. Returns EINTERNAL if no lfsc.Error is found.
func FormatLTXFilename ¶
FormatLTXFilename returns a filename based on the min & max TXID.
func IsApplicationError ¶
IsApplicationError returns true if err is an lfsc.Error or ltx.PositionMismatchError.
func ParseLTXFilename ¶
ParseLTXFilename parses a base filename into min & max TXID. Returns ErrInvalidLTXFilename if it is invalid.
func ValidateClusterName ¶
ValidateClusterName returns nil if s is a valid cluster.
func ValidateDatabase ¶
ValidateDatabase returns nil if s is a valid database name.
Types ¶
type Config ¶
type Config struct { // Path is the directory where litefs-backup should store its // local data. Path string // Address is the address to bind to. Address string // S3Bucket is the bucket to use for long term storage. S3Bucket string // S3Endpoint is the S3 api endpoint to use. Useful for using S3-compatible alternatives. S3Endpoint string // SentryDSN is the sentry DSN to use. // See: https://docs.sentry.io/concepts/key-terms/dsn-explainer/ SentryDSN string }
func ConfigFromEnv ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
lfsb/cmd
* From https://github.com/superfly/flyctl/blob/19481dfa110c8a6274500321b3214c5d2abbfc71/internal/render/render.go * Copyright 2023 https://github.com/superfly * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* From https://github.com/superfly/flyctl/blob/19481dfa110c8a6274500321b3214c5d2abbfc71/internal/render/render.go * Copyright 2023 https://github.com/superfly * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
lfsb/cmd/client
* Copyright 2023 https://github.com/superfly * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2023 https://github.com/superfly * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
db
|
|
Click to show internal directories.
Click to hide internal directories.