Documentation
¶
Index ¶
- Constants
- Variables
- func AppendBlocksList(blocks []uint16, size int64, blockShift, chunkShift shift.Shift) []uint16
- func ContiguousBytes(in [][]byte) []byte
- func DefaultChunkShift(fileSize int64) shift.Shift
- func IsContextError(err error) bool
- func IsNotFound(err error) bool
- func LoadFromFileOrHttpUrl(urlString string) ([]byte, error)
- func LoadPubKeys(keys []string) ([]signature.PublicKey, error)
- func LoadSecretKeys(keyfiles []string) ([]signature.SecretKey, error)
- func NormalizeUpstream(u *string)
- func RetryHttpRequest(ctx context.Context, method, url, cType string, body []byte) (*http.Response, error)
- func SignInlineMessage(keys []signature.SecretKey, context string, msg proto.Message) ([]byte, error)
- func SignMessageAsEntry(keys []signature.SecretKey, params *pb.GlobalParams, e *pb.Entry) ([]byte, error)
- func TruncU8[...](v L) uint8
- func TruncU16[L ~int | ~int32 | ~int64 | ~uint | ~uint16 | ~uint32 | ~uint64](v L) uint16
- func TruncU32[L ~int | ~int64 | ~uint | ~uint32 | ~uint64](v L) uint32
- func TruncU64[L ~int | ~int64 | ~uint | ~uint64](v L) uint64
- func ValOrErr[T any](v T, err error) (T, error)
- func VerifyInlineMessage(keys []signature.PublicKey, expectedContext string, b []byte, ...) error
- func VerifyMessageAsEntry(keys []signature.PublicKey, expectedContext string, b []byte) (*pb.Entry, *pb.GlobalParams, error)
- type ChunkPool
- type HttpError
- type NotFoundable
- type SimpleSyncMap
- func (ssm *SimpleSyncMap[K, V]) Delete(k K)
- func (ssm *SimpleSyncMap[K, V]) DeleteFunc(f func(K, V) bool)
- func (ssm *SimpleSyncMap[K, V]) Get(k K) (V, bool)
- func (ssm *SimpleSyncMap[K, V]) GetOrPut(k K, v V) (V, bool)
- func (ssm *SimpleSyncMap[K, V]) Has(k K) bool
- func (ssm *SimpleSyncMap[K, V]) Modify(k K, f func(V, bool) (V, bool))
- func (ssm *SimpleSyncMap[K, V]) Put(k K, v V)
- func (ssm *SimpleSyncMap[K, V]) WithValue(k K, f func(V))
- type ZstdCtxPool
Constants ¶
View Source
const ( // Context for signatures ManifestContext = "styx-manifest-1" DaemonParamsContext = "styx-daemon-params-1" )
View Source
const ( CTHdr = "Content-Type" CTJson = "application/json" CTProto = "application/protobuf" )
Variables ¶
View Source
var ( // binary paths (can be overridden by ldflags) NixBin = "nix" GzipBin = "gzip" XzBin = "xz" FilefragBin = "filefrag" // replaced by ldflags Version = "dev" )
Functions ¶
func AppendBlocksList ¶
func ContiguousBytes ¶
func DefaultChunkShift ¶
func IsContextError ¶
func IsNotFound ¶
func LoadFromFileOrHttpUrl ¶
func NormalizeUpstream ¶
func NormalizeUpstream(u *string)
func RetryHttpRequest ¶
func SignInlineMessage ¶
func SignMessageAsEntry ¶
Types ¶
type ChunkPool ¶
type ChunkPool struct {
// contains filtered or unexported fields
}
func NewChunkPool ¶
func NewChunkPool() *ChunkPool
type HttpError ¶
type HttpError struct {
// contains filtered or unexported fields
}
func HttpErrorFromRes ¶
note: this does not close res.Body, caller should close it
func NewHttpError ¶
func (HttpError) IsNotFound ¶
type NotFoundable ¶
type NotFoundable interface {
IsNotFound() bool
}
type SimpleSyncMap ¶
type SimpleSyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSimpleSyncMap ¶
func NewSimpleSyncMap[K comparable, V any]() *SimpleSyncMap[K, V]
func (*SimpleSyncMap[K, V]) Delete ¶
func (ssm *SimpleSyncMap[K, V]) Delete(k K)
func (*SimpleSyncMap[K, V]) DeleteFunc ¶
func (ssm *SimpleSyncMap[K, V]) DeleteFunc(f func(K, V) bool)
Deletes entries where f(k, v) returns true.
func (*SimpleSyncMap[K, V]) Get ¶
func (ssm *SimpleSyncMap[K, V]) Get(k K) (V, bool)
func (*SimpleSyncMap[K, V]) GetOrPut ¶
func (ssm *SimpleSyncMap[K, V]) GetOrPut(k K, v V) (V, bool)
If k is present, returns its value and true, otherwise sets k to v and returns v and false.
func (*SimpleSyncMap[K, V]) Has ¶
func (ssm *SimpleSyncMap[K, V]) Has(k K) bool
func (*SimpleSyncMap[K, V]) Modify ¶
func (ssm *SimpleSyncMap[K, V]) Modify(k K, f func(V, bool) (V, bool))
Atomically calls f with the result of Get(k) and then either sets k to a new value or deletes k.
func (*SimpleSyncMap[K, V]) Put ¶
func (ssm *SimpleSyncMap[K, V]) Put(k K, v V)
func (*SimpleSyncMap[K, V]) WithValue ¶
func (ssm *SimpleSyncMap[K, V]) WithValue(k K, f func(V))
Calls f on the value of key k, while holding the lock.
type ZstdCtxPool ¶
type ZstdCtxPool struct {
// contains filtered or unexported fields
}
func GetZstdCtxPool ¶
func GetZstdCtxPool() *ZstdCtxPool
func (*ZstdCtxPool) Get ¶
func (z *ZstdCtxPool) Get() zstd.Ctx
func (*ZstdCtxPool) Put ¶
func (z *ZstdCtxPool) Put(c zstd.Ctx)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
|
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task. |
Click to show internal directories.
Click to hide internal directories.