asb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// FormatVersion is the current version of the ASB encoding format
	FormatVersion = "3.1"
)

misc constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder contains logic for decoding backup data from the .asb format.

func NewDecoder

func NewDecoder(src io.Reader) (*Decoder, error)

NewDecoder creates a new Decoder.

func (*Decoder) NextToken

func (r *Decoder) NextToken() (*models.Token, error)

func (*Decoder) ReadByte

func (c *Decoder) ReadByte() (byte, error)

func (*Decoder) UnreadByte

func (c *Decoder) UnreadByte() error

type Encoder

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

Encoder contains logic for encoding backup data into the .asb format. This is a stateful object that must be created for every backup operation.

func NewEncoder

func NewEncoder(namespace string, compact bool) *Encoder

NewEncoder creates a new Encoder.

func (*Encoder) EncodeToken

func (e *Encoder) EncodeToken(token *models.Token) ([]byte, error)

EncodeToken encodes a token to the ASB format. It returns a byte slice of the encoded token and an error if the encoding fails.

func (*Encoder) GenerateFilename

func (e *Encoder) GenerateFilename(prefix, suffix string) string

GenerateFilename generates a file name for the given namespace.

func (*Encoder) GetHeader

func (e *Encoder) GetHeader() []byte

type UserKeyTypesInt

type UserKeyTypesInt interface {
	int64 | int32 | int16 | int8 | int
}

type Validator

type Validator struct {
}

Validator represents backup files validator.

func NewValidator

func NewValidator() *Validator

NewValidator returns new validator instance for files validation.

func (*Validator) Run

func (v *Validator) Run(fileName string) error

Run performs backup files validation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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