ctsubmit

package
v0.0.0-...-077c4e2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RHURecordSize = 21
	RHUHashSize   = 16
	// Sunlight defines index size to be 40 bits or 5 bytes
	RHULeafIndexSize = 5
)
View Source
const (
	DDURecordSize = 29
	DDUHashSize   = 16
	// Sunlight defines index size to be 40 bits or 5 bytes
	DDULeafIndexSize = 5
	DDUTimestampSize = 8
)

Variables

This section is empty.

Functions

func MainMain

func MainMain(ctx context.Context, listener net.Listener, kvpath, consulAddress string, startSignal chan<- struct{})

This is seperated so we can run this in the integration test. Tests don't need to export Otel to Honeycomb.

Types

type Bucket

type Bucket struct {
	S Storage
}

func (*Bucket) GetDedupeEntry

func (b *Bucket) GetDedupeEntry(ctx context.Context, hash [16]byte, mask int) (DedupeUpload, error)

func (*Bucket) GetRecordHash

func (b *Bucket) GetRecordHash(ctx context.Context, hash [16]byte, mask int) (RecordHashUpload, error)

func (*Bucket) PutDedupeEntries

func (b *Bucket) PutDedupeEntries(ctx context.Context, hashes []DedupeUpload, mask int) error

TODO: This NEEDS unit testing

func (*Bucket) PutRecordHashes

func (b *Bucket) PutRecordHashes(ctx context.Context, hashes []RecordHashUpload, mask int) error

TODO: This NEEDS unit testing TODO: convert these to use binary search

func (*Bucket) SetCheckpoint

func (b *Bucket) SetCheckpoint(ctx context.Context, data []byte) error

func (*Bucket) SetIssuer

func (b *Bucket) SetIssuer(ctx context.Context, cert *x509.Certificate) error

func (*Bucket) SetSth

func (b *Bucket) SetSth(ctx context.Context, data []byte) error

func (*Bucket) SetTile

func (b *Bucket) SetTile(ctx context.Context, tile tlog.Tile, data []byte) error

type DedupeUpload

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

func BytesToDedupe

func BytesToDedupe(b []byte) (DedupeUpload, error)

func (*DedupeUpload) ToBytes

func (r *DedupeUpload) ToBytes() []byte

type FsStorage

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

func NewFsStorage

func NewFsStorage(rootDirectory string) FsStorage

func (*FsStorage) Exists

func (f *FsStorage) Exists(ctx context.Context, key string) (bool, error)

func (*FsStorage) Get

func (f *FsStorage) Get(ctx context.Context, key string) ([]byte, error)

func (*FsStorage) Set

func (f *FsStorage) Set(ctx context.Context, key string, data []byte) error

type GlobalConfig

type GlobalConfig struct {
	Name          string `json:"name"`
	KeyPath       string `json:"keyPath"`
	LogID         string `json:"logID"`
	ListenAddress string `json:"listenAddress"`
	MaskSize      int    `json:"maskSize"`

	// If this is set, the log will write to the filesystem instead of S3
	// This value is prefered over the S3 values
	RootDirectory string `json:"rootDirectory"`

	S3Bucket                   string `json:"s3Bucket"`
	S3Region                   string `json:"s3Region"`
	S3EndpointUrl              string `json:"s3EndpointUrl"`
	S3StaticCredentialUserName string `json:"s3StaticCredentialUserName"`
	S3StaticCredentialPassword string `json:"s3StaticCredentialPassword"`

	NotAfterStart string `json:"notAfterStart"`
	NotAfterLimit string `json:"notAfterLimit"`
	FlushMs       int    `json:"flushMs"`
}

type Log

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

func LoadLog

func LoadLog(ctx context.Context, kvpath, consulAddress string) (*Log, error)

func (*Log) Start

func (l *Log) Start(ctx context.Context) (http.Handler, error)

TODO: Evaluate if the context is actually needed

type LogEntryWithReturnPath

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

type RecordHashUpload

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

func BytesToRecord

func BytesToRecord(b []byte) (RecordHashUpload, error)

func (*RecordHashUpload) ToBytes

func (r *RecordHashUpload) ToBytes() []byte

type S3Storage

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

func NewS3Storage

func NewS3Storage(region, bucket, endpoint, username, password string) S3Storage

func (*S3Storage) Exists

func (b *S3Storage) Exists(ctx context.Context, key string) (bool, error)

func (*S3Storage) Get

func (b *S3Storage) Get(ctx context.Context, key string) ([]byte, error)

func (*S3Storage) Set

func (b *S3Storage) Set(ctx context.Context, key string, data []byte) error

type Storage

type Storage interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, data []byte) error
	Exists(ctx context.Context, key string) (bool, error)
}

type UnsequencedEntryWithReturnPath

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

Jump to

Keyboard shortcuts

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