Documentation ¶
Overview ¶
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cmn provides common constants, types, and utilities for AIS clients and AIStore.
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cmn provides common constants, types, and utilities for AIS clients and AIStore.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects.
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package cos provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- Variables
- func AnyHasPrefixInSlice(prefix string, arr []string) bool
- func Assert(cond bool)
- func AssertMsg(cond bool, msg string)
- func AssertNoErr(err error)
- func Assertf(cond bool, f string, a ...any)
- func BHead(b []byte, ls ...int) string
- func CeilAlign(val, align uint) uint
- func CeilAlignInt64(val, align int64) int64
- func CheckAlphaPlus(s, tag string) error
- func ClearfAtomic(f *uint64, flags uint64) (ok bool)
- func Close(closer io.Closer)
- func ConvertToString(value any) (valstr string, err error)
- func CopyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err error)
- func CopyStruct(dst, src any)
- func CreateDir(dir string) error
- func CreateFile(fqn string) (*os.File, error)
- func CryptoRandS(n int) string
- func DivCeil(a, b int64) int64
- func DivRound(a, b int64) int64
- func DivRoundU64(a, b uint64) uint64
- func DrainReader(r io.Reader)
- func Err2ClientURLErr(err error) (uerr *url.Error)
- func Errorf(format string, a ...any)
- func Errorln(a ...any)
- func ExitAssertLog(cond bool, a ...any)
- func ExitLog(a ...any)
- func ExitLogf(f string, a ...any)
- func Exitf(f string, a ...any)
- func ExpandPath(path string) string
- func Ext(path string) (ext string)
- func FloodWriter(w io.Writer, n int64) error
- func FlushClose(file *os.File) (err error)
- func FormatBigNum(n int) (s string)
- func FormatMilli(tm time.Duration) string
- func FormatNanoTime(unixnano int64, format string) string
- func FormatNowStamp() string
- func FormatTime(t time.Time, format string) string
- func FreeMemToOS(force bool) bool
- func GenBEID(val uint64, l int) string
- func GenDaemonID() string
- func GenTestingDaemonID(suffix string) string
- func GenTie() string
- func GenUUID() (uuid string)
- func GetEnvOrDefault(envVar, defaultValue string) string
- func HashK8sProxyID(nodeName string) (pid string)
- func HomeConfigDir(subdir string) (configDir string)
- func HomeDir() (string, error)
- func Infoln(a ...any)
- func InitShortID(seed uint64)
- func IsAlphaNice(s string) bool
- func IsAnySetfAtomic(f *uint64, flags uint64) (yes bool)
- func IsAzureURL(u *url.URL) bool
- func IsEOF(err error) bool
- func IsErrBadCksum(err error) bool
- func IsErrBrokenPipe(err error) (yes bool)
- func IsErrClientURLTimeout(err error) bool
- func IsErrConnectionNotAvail(err error) (yes bool)
- func IsErrConnectionRefused(err error) (yes bool)
- func IsErrConnectionReset(err error) (yes bool)
- func IsErrDNSLookup(err error) bool
- func IsErrNotFound(err error) bool
- func IsErrOOS(err error) bool
- func IsErrSyscallTimeout(err error) bool
- func IsErrXattrNotFound(err error) bool
- func IsGoogleAPIURL(u *url.URL) bool
- func IsGoogleStorageURL(u *url.URL) bool
- func IsHT(url string) bool
- func IsHTTPS(url string) bool
- func IsIOError(err error) bool
- func IsLastB(s string, b byte) bool
- func IsNotExist(err error, ecode int) bool
- func IsParseBool(s string) bool
- func IsParseEnvBoolOrDefault(envVar string, defaultValue bool) (bool, error)
- func IsRetriableConnErr(err error) (yes bool)
- func IsS3URL(link string) bool
- func IsSetfAtomic(f *uint64, flags uint64) (yes bool)
- func IsTimeZero(t time.Time) bool
- func IsUnreachable(err error, status int) bool
- func IsValidAtime(atime int64) bool
- func IsValidUUID(uuid string) bool
- func JoinPath(url, path string) string
- func JoinWords(w string, words ...string) (path string)
- func Left(left, right string) string
- func MatchAll(template string) bool
- func MorphMarshal(data, v any) error
- func MustMarshal(v any) []byte
- func MustMarshalToString(v any) string
- func MustMorphMarshal(data, v any)
- func NewCRC32C() hash.Hash
- func NewErrDataCksum(a, b *Cksum, context ...string) error
- func NewErrMetaCksum(a, b uint64, context ...string) error
- func NewNowSource() rand.Source
- func NewRandSource(seed uint64) rand.Source
- func NopReader(size int64) io.Reader
- func NowRand() *rand.Rand
- func PackedBytesLen(b []byte) int
- func PackedStrLen(s string) int
- func ParseBool(s string) (bool, error)
- func ParseSize(size, units string) (int64, error)
- func ParseURL(s string) (u *url.URL, valid bool)
- func Plural(num int) (s string)
- func ProbingFrequency(dur time.Duration) time.Duration
- func RandStringWithSrc(src rand.Source, n int) string
- func Ratio(high, low, curr int64) float32
- func RatioPct(high, low, curr int64) int64
- func ReadAll(r io.Reader) ([]byte, error)
- func ReadAllN(r io.Reader, size int64) (b []byte, err error)
- func ReadLines(filename string, cb func(string) error) error
- func ReadOneInt64(filename string) (int64, error)
- func ReadOneLine(filename string) (string, error)
- func ReadOneUint64(filename string) (uint64, error)
- func RemoveFile(path string) (err error)
- func Rename(src, dst string) (err error)
- func ReparseQuery(r *http.Request)
- func Right(left, right string) string
- func S2Duration(s string) (time.Duration, error)
- func S2UnixNano(s string) (int64, error)
- func SHead(s string) string
- func SetfAtomic(f *uint64, flags uint64) (ok bool)
- func Stat(path string) error
- func StrSlicesEqual(lhs, rhs []string) bool
- func StringInSlice(s string, arr []string) bool
- func SupportedChecksums() (types []string)
- func ToSizeIEC(b int64, digits int) string
- func TrimLastB(s string, b byte) string
- func UnixNano2S(unixnano int64) string
- func UnsafeB(s string) []byte
- func UnsafeBptr(s *string) *[]byte
- func UnsafeS(b []byte) string
- func UnsafeSptr(b []byte) *string
- func UnwrapSyscallErr(err error) error
- func ValidateCksumType(ty string, emptyOK ...bool) (err error)
- func ValidateDaemonID(id string) error
- func WdsKey(path string) (key string)
- type BitFlags
- type Bits
- type Buffer
- type ByteHandle
- type BytePack
- func (bw *BytePack) Bytes() []byte
- func (bw *BytePack) WriteAny(st Packer)
- func (bw *BytePack) WriteBool(b bool)
- func (bw *BytePack) WriteByte(b byte)
- func (bw *BytePack) WriteBytes(b []byte)
- func (bw *BytePack) WriteInt16(i int16)
- func (bw *BytePack) WriteInt32(i int32)
- func (bw *BytePack) WriteInt64(i int64)
- func (bw *BytePack) WriteMapStrUint16(mp MapStrUint16)
- func (bw *BytePack) WriteString(s string)
- func (bw *BytePack) WriteUint16(i uint16)
- func (bw *BytePack) WriteUint32(i uint32)
- func (bw *BytePack) WriteUint64(i uint64)
- type ByteUnpack
- func (br *ByteUnpack) Bytes() []byte
- func (br *ByteUnpack) Len() int
- func (br *ByteUnpack) ReadAny(st Unpacker) error
- func (br *ByteUnpack) ReadBool() (bool, error)
- func (br *ByteUnpack) ReadByte() (byte, error)
- func (br *ByteUnpack) ReadBytes() ([]byte, error)
- func (br *ByteUnpack) ReadInt16() (int16, error)
- func (br *ByteUnpack) ReadInt32() (int32, error)
- func (br *ByteUnpack) ReadInt64() (int64, error)
- func (br *ByteUnpack) ReadMapStrUint16() (MapStrUint16, error)
- func (br *ByteUnpack) ReadString() (string, error)
- func (br *ByteUnpack) ReadUint16() (uint16, error)
- func (br *ByteUnpack) ReadUint32() (uint32, error)
- func (br *ByteUnpack) ReadUint64() (uint64, error)
- type CallbackROC
- type Cksum
- func (ck *Cksum) Clone() *Cksum
- func (ck *Cksum) Equal(to *Cksum) bool
- func (ck *Cksum) Get() (string, string)
- func (ck *Cksum) IsEmpty() bool
- func (ck *Cksum) MarshalJSON() ([]byte, error)
- func (ck *Cksum) String() string
- func (ck *Cksum) Ty() string
- func (ck *Cksum) Type() string
- func (ck *Cksum) Val() string
- func (ck *Cksum) Value() string
- type CksumHash
- func CopyAndChecksum(w io.Writer, r io.Reader, buf []byte, cksumType string) (n int64, cksum *CksumHash, err error)
- func CopyFile(src, dst string, buf []byte, cksumType string) (written int64, cksum *CksumHash, err error)
- func NewCksumHash(ty string) (ck *CksumHash)
- func SaveReader(fqn string, reader io.Reader, buf []byte, cksumType string, size int64) (*CksumHash, error)
- type CksumHashSize
- type Duration
- type DynSemaphore
- type ErrBadCksum
- type ErrNotFound
- type ErrSignal
- type Errs
- type FS
- type FileHandle
- type FileSectionHandle
- type FsID
- type JSONRawMsgs
- type LimitedWaitGroup
- type LogLevel
- type LomReader
- type LomWriter
- type MapStrUint16
- type MultiSyncMap
- type NamedVal64
- type NodeStateFlags
- func (f NodeStateFlags) Clear(flags NodeStateFlags) NodeStateFlags
- func (f NodeStateFlags) IsOK() bool
- func (f NodeStateFlags) IsRed() bool
- func (f NodeStateFlags) IsSet(flag NodeStateFlags) bool
- func (f NodeStateFlags) IsWarn() bool
- func (f NodeStateFlags) Set(flags NodeStateFlags) NodeStateFlags
- func (f NodeStateFlags) String() string
- type NodeStateInfo
- type NopLocker
- type OAH
- type Packer
- type ParsedQuantity
- type ParsedTemplate
- type ReadCloseSizer
- type ReadOpenCloseSizer
- type ReadOpenCloser
- type ReadReaderAt
- type ReadSizer
- type ReadWrapperFunc
- type ReaderArgs
- type ReaderWithArgs
- type Runner
- type SectionHandle
- type Semaphore
- type SetSizeFunc
- type SimpleOAH
- func (s SimpleOAH) AtimeUnix() int64
- func (SimpleOAH) Checksum() *Cksum
- func (SimpleOAH) GetCustomKey(string) (string, bool)
- func (SimpleOAH) GetCustomMD() StrKVs
- func (s SimpleOAH) Lsize(...bool) int64
- func (SimpleOAH) SetCustomKey(_, _ string)
- func (SimpleOAH) String() string
- func (SimpleOAH) Version(...bool) string
- func (SimpleOAH) VersionPtr() *string
- type SizeIEC
- type StatsUpdater
- type StopCh
- type StrKVs
- type StrSet
- func (ss StrSet) Add(keys ...string)
- func (ss StrSet) All(xs ...string) bool
- func (ss StrSet) Clone() StrSet
- func (ss StrSet) Contains(key string) (yes bool)
- func (ss StrSet) Delete(key string)
- func (ss StrSet) Intersection(other StrSet) StrSet
- func (ss StrSet) Set(key string)
- func (ss StrSet) String() string
- func (ss StrSet) ToSlice() []string
- type TemplateRange
- type TimeoutGroup
- type Unpacker
- type WG
- type WriteSizer
- type WriterAt
- type WriterMulti
- type WriterOnly
- type WriterTo2
Constants ¶
const ( ChecksumNone = "none" ChecksumXXHash = "xxhash" ChecksumMD5 = "md5" ChecksumCRC32C = "crc32c" ChecksumSHA256 = "sha256" // crypto.SHA512_256 (SHA-2) ChecksumSHA512 = "sha512" // crypto.SHA512 (SHA-2) )
checksums
const ( CtxReadWrapper contextID = "readWrapper" // context key for ReadWrapperFunc CtxSetSize contextID = "setSize" // context key for SetSizeFunc CtxOriginalURL contextID = "origURL" // context key for OriginalURL for HTTP cloud )
const ( ContentJSON = "application/json" ContentJSONCharsetUTF = "application/json; charset=utf-8" ContentMsgPack = "application/msgpack" ContentXML = "application/xml" ContentBinary = "application/octet-stream" // not present in IANA registry // mozilla.org has it though, and also https://en.wikipedia.org/wiki/List_of_archive_formats ContentTar = "application/x-tar" // not currently used ContentZip = "application/zip" )
standard MIME types - https://www.iana.org/assignments/media-types/media-types.xhtml - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
const ( // range to read: HdrRange = "Range" // Ref: https://www.rfc-editor.org/rfc/rfc7233#section-2.1 HdrRangeValPrefix = "bytes=" // range read response: HdrContentRange = "Content-Range" HdrContentRangeValPrefix = "bytes " // Ref: https://tools.ietf.org/html/rfc7233#section-4.2 HdrAcceptRanges = "Accept-Ranges" // content length & type HdrContentType = "Content-Type" HdrContentTypeOptions = "X-Content-Type-Options" HdrContentLength = "Content-Length" // misc. gen HdrUserAgent = "User-Agent" HdrAccept = "Accept" HdrLocation = "Location" HdrServer = "Server" HdrETag = "ETag" // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag HdrHSTS = "Strict-Transport-Security" )
Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
const ( // https://cloud.google.com/storage/docs/xml-api/reference-headers GsCksumHeader = "x-goog-hash" GsVersionHeader = "x-goog-generation" )
const ( // https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html // https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html S3CksumHeader = HdrETag S3VersionHeader = "x-amz-version-id" // s3 api request headers S3HdrObjSrc = "x-amz-copy-source" S3HdrMptCnt = "x-amz-mp-parts-count" // https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html S3UnsignedPayload = "UNSIGNED-PAYLOAD" S3HdrContentSHA256 = "x-amz-content-sha256" S3HdrBckRegion = "x-amz-bucket-region" S3ChecksumCRC32 = "x-amz-checksum-crc32" S3ChecksumCRC32C = "x-amz-checksum-crc32c" S3ChecksumSHA1 = "x-amz-checksum-sha1" S3ChecksumSHA256 = "x-amz-checksum-sha256" S3MetadataChecksumType = "x-amz-meta-ais-cksum-type" S3MetadataChecksumVal = "x-amz-meta-ais-cksum-val" S3LastModified = "Last-Modified" )
const ( // https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties#response-headers AzCksumHeader = "Content-MD5" AzVersionHeader = HdrETag )
const ( PermRWR os.FileMode = 0o640 PermRWRR os.FileMode = 0o644 // (archived) PermRWXRX os.FileMode = 0o750 )
POSIX permissions
const ( SmoduleTransport = 1 << iota SmoduleAIS SmoduleMemsys SmoduleCore SmoduleFS SmoduleReb SmoduleEC SmoduleStats SmoduleIOS SmoduleXs SmoduleBackend SmoduleSpace SmoduleMirror SmoduleDsort SmoduleDload SmoduleETL SmoduleS3 )
const ( VoteInProgress = NodeStateFlags(1 << iota) // warning ClusterStarted // info: (primary: cluster-started | all other nodes: joined-cluster) NodeStarted // info: (started; possibly, not joined yet) Rebalancing // warning RebalanceInterrupted // warning Resilvering // warning ResilverInterrupted // warning Restarted // warning OOS // red alert (see IsRed below) OOM // red alert MaintenanceMode // warning LowCapacity // (used > high); warning: OOS possible soon.. LowMemory // ditto OOM DiskFault // red NoMountpaths // red: (reserved, not used) NumGoroutines // red CertWillSoonExpire // warning X.509 CertificateExpired // red --/-- CertificateInvalid // red --/-- KeepAliveErrors // warning (new keep-alive errors during the last 5m) )
const ( QuantityPercent = "percent" QuantityBytes = "bytes" )
const ( LetterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" LenRunes = len(LetterRunes) )
const ( UnitsIEC = "iec" // default UnitsSI = "si" // NOTE: currently, SI system is CLI-only (compare with cmn/cos/size.go) UnitsRaw = "raw" )
const ( KiB = 1024 MiB = 1024 * KiB GiB = 1024 * MiB TiB = 1024 * GiB )
IEC (binary) units
const ( KB = 1000 MB = 1000 * KB GB = 1000 * MB TB = 1000 * GB )
IS (metric) units
const ( StreamsOutObjCount = "stream.out.n" StreamsOutObjSize = "stream.out.size" StreamsInObjCount = "stream.in.n" StreamsInObjSize = "stream.in.size" )
intra-cluster transmit & receive (cumulative counters)
const ( // Number of sync maps MultiSyncMapCount = 0x40 // m.b. a power of two MultiSyncMapMask = MultiSyncMapCount - 1 )
const ( WildcardMatchAll = "*" EmptyMatchAll = "" )
const ( StampMicro = "15:04:05.000000" // time.StampMicro without a date StampSec = "15:04:05" // time.Stamp without a date // S3 ListObjectsV2 // https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html ISO8601 = "2006-01-02T15:04:05.000Z" // S3 HeadObject // https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_Examples RFC1123GMT = "Mon, 17 Dec 2012 02:14:10 GMT" )
in addition to standard layouts at /usr/local/go/src/time/format.go
const ( SizeofI64 = int(unsafe.Sizeof(uint64(0))) SizeofI32 = int(unsafe.Sizeof(uint32(0))) SizeofI16 = int(unsafe.Sizeof(uint16(0))) )
assorted common constants
const ( OnlyNice = "must be less than 32 characters and " + mayOnlyContain // NOTE tooLongID OnlyPlus = mayOnlyContain + ", and dots (.)" )
const ContentLengthUnknown = -1
const (
LenShortID = 9 // UUID length, as per https://github.com/teris-io/shortid#id-length
)
const MLCG32 = 1103515245 // xxhash seed
const NodeAlerts = "state.flags"
const PathSeparator = string(filepath.Separator)
const SizeofLen = SizeofI32
Internally size of byte slice or string is packed as this integer type. Since binary packed structs are used for fairly small amount of data, it is possible to use int32 instead of int64 to keep the length of the data.
Variables ¶
var ( ErrQuantityUsage = errors.New("invalid quantity, format should be '81%' or '1GB'") ErrQuantityPercent = errors.New("percent must be in the range (0, 100)") ErrQuantityBytes = errors.New("value (bytes) must be non-negative") )
var (
ErrEmptyTemplate = errors.New("empty range template")
)
var ErrWorkChanFull = errors.New("work channel full")
var JSON jsoniter.API
JSON is used to Marshal/Unmarshal API json messages and is initialized in init function.
var NoneCksum = NewCksum(ChecksumNone, "")
var Smodules = [...]string{
"transport", "ais", "memsys", "cluster", "fs", "reb", "ec", "stats",
"ios", "xs", "backend", "space", "mirror", "dsort", "downloader", "etl",
"s3",
}
NOTE: keep in-sync with the above
Functions ¶
func AnyHasPrefixInSlice ¶
func AssertMsg ¶
NOTE: when using Sprintf and such, `if (!cond) { AssertMsg(false, msg) }` is the preferable usage.
func AssertNoErr ¶
func AssertNoErr(err error)
func CeilAlignInt64 ¶
func CheckAlphaPlus ¶ added in v1.3.24
alpha-numeric++ including letters, numbers, dashes (-), and underscores (_) period (.) is allowed except for '..' (OnlyPlus const)
func ClearfAtomic ¶
func ConvertToString ¶
func CopyBuffer ¶ added in v1.3.22
a slightly modified excerpt from https://github.com/golang/go/blob/master/src/io/io.go#L407 - regular streaming copy with `io.WriteTo` and `io.ReaderFrom` not checked and not used - buffer _must_ be provided - see also: WriterOnly comment (above)
func CreateDir ¶
CreateDir creates directory if does not exist. If the directory already exists returns nil.
func CreateFile ¶
CreateFile creates a new write-only (O_WRONLY) file with default cos.PermRWR permissions. NOTE: if the file pathname doesn't exist it'll be created. NOTE: if the file already exists it'll be also silently truncated.
func CryptoRandS ¶ added in v1.3.16
func DivRoundU64 ¶
func DrainReader ¶
DrainReader reads and discards all the data from a reader. No need for `io.CopyBuffer` as `io.Discard` has efficient `io.ReaderFrom` implementation.
func Err2ClientURLErr ¶ added in v1.3.16
func ExpandPath ¶
ExpandPath replaces common abbreviations in file path (eg. `~` with absolute path to the current user home directory) and cleans the path.
func Ext ¶ added in v1.3.18
e.g.: "/aaa/bbb/ccc.tar.gz" => ".tar.gz", while "/aaa/bb.b/ccctargz" => ""
func FloodWriter ¶
FloodWriter writes `n` random bytes to provided writer.
func FlushClose ¶
func FormatBigNum ¶ added in v1.3.20
func FormatMilli ¶
FormatMilli returns a duration formatted as milliseconds. For values bigger than millisecond, it returns an integer number "#ms". For values smaller than millisecond, the function returns fractional number "0.##ms"
func FormatNanoTime ¶ added in v1.3.16
`unixnano` here is expected to be "nanoseconds since January 1, 1970 UTC"
func FormatNowStamp ¶ added in v1.3.16
func FormatNowStamp() string
func FreeMemToOS ¶
FreeMemToOS executes in a separate goroutine with at least so-many minutes (above) between the runs. It calls GC and returns allocated memory to the operating system. Notes:
- `forceFreeMemTime` is expected to be significantly greater than the time spent in the goroutine
- still, an unlikely case of overlapping runs is treated via `runningOOM`
- for somewhat related OOS handling - esp. constants - see ais/tgtspace.go
func GenBEID ¶ added in v1.3.19
"best-effort ID" - to independently and locally generate globally unique ID called by xreg.GenBEID
func GenDaemonID ¶
func GenDaemonID() string
func GetEnvOrDefault ¶ added in v1.3.24
getEnvOrDefault returns the value of the environment variable if it exists, otherwise it returns the provided default value.
func HashK8sProxyID ¶ added in v1.3.23
func HomeConfigDir ¶
func InitShortID ¶
func InitShortID(seed uint64)
func IsAlphaNice ¶ added in v1.3.16
letters and numbers w/ '-' and '_' permitted with limitations (see OnlyNice const)
func IsAnySetfAtomic ¶
func IsAzureURL ¶
func IsEOF ¶
including "unexpecting EOF" to accommodate unsized streaming and early termination of the other side (prior to sending the first byte)
func IsErrBadCksum ¶
func IsErrBrokenPipe ¶
func IsErrClientURLTimeout ¶ added in v1.3.16
func IsErrConnectionNotAvail ¶
likely out of socket descriptors
func IsErrConnectionReset ¶
func IsErrDNSLookup ¶ added in v1.3.24
func IsErrNotFound ¶ added in v1.3.18
func IsErrSyscallTimeout ¶ added in v1.3.16
func IsErrXattrNotFound ¶
func IsGoogleAPIURL ¶
func IsGoogleStorageURL ¶
func IsIOError ¶
Checks if the error is generated by any IO operation and if the error is severe enough to run the FSHC for mountpath testing
func IsNotExist ¶ added in v1.3.22
NOTE: compare with cmn.IsErrObjNought() that also includes lmeta-not-found et al.
func IsParseBool ¶
func IsParseEnvBoolOrDefault ¶ added in v1.3.24
IsParseBoolOrDefault parses a boolean from the environment variable string or returns the default value if parsing fails.
func IsRetriableConnErr ¶
func IsSetfAtomic ¶
func IsTimeZero ¶
func IsUnreachable ¶
func IsValidAtime ¶ added in v1.3.18
access time validity; prefetch special (negative) case - sets atime=-now 946771140000000000 = time.Parse(time.RFC3339Nano, "2000-01-01T23:59:00Z").UnixNano()
func IsValidUUID ¶
func JoinPath ¶
JoinPath joins two path elements that may (or may not) be prefixed/suffixed with a slash.
func JoinWords ¶
JoinWords uses forward slash to join any number of words into a single path. Returned path is prefixed with a slash.
func MorphMarshal ¶
func MustMarshal ¶
MustMarshal marshals v and panics if error occurs.
func MustMarshalToString ¶
func MustMorphMarshal ¶
func MustMorphMarshal(data, v any)
func NewErrDataCksum ¶ added in v1.3.18
func NewErrMetaCksum ¶ added in v1.3.18
func NewNowSource ¶ added in v1.3.23
func NewNowSource() rand.Source
func NewRandSource ¶ added in v1.3.23
func NewRandSource(seed uint64) rand.Source
func PackedBytesLen ¶ added in v1.3.24
func PackedStrLen ¶
PackedStrLen returns the size occupied by a given string in the output
func ParseBool ¶
ParseBool converts string to bool (case-insensitive):
y, yes, on -> true n, no, off, <empty value> -> false
strconv handles the following:
1, true, t -> true 0, false, f -> false
func ProbingFrequency ¶
wait duration => probing frequency
func RandStringWithSrc ¶
func ReadLines ¶
Read a file line by line and call a callback for each line until the file ends or a callback returns io.EOF
func ReadOneInt64 ¶
Read only the first line of a file and return it as int64 Do not use for big files: it reads all the content and then extracts the first line. Use for files that may contains a few lines with trailing EOL
func ReadOneLine ¶
Read only the first line of a file. Do not use for big files: it reads all the content and then extracts the first line. Use for files that may contains a few lines with trailing EOL
func ReadOneUint64 ¶
Read only the first line of a file and return it as uint64 Do not use for big files: it reads all the content and then extracts the first line. Use for files that may contains a few lines with trailing EOL
func RemoveFile ¶
RemoveFile removes path; returns nil upon success or if the path does not exist.
func ReparseQuery ¶
WARNING: `ReparseQuery` might affect non-tensorflow clients using S3-compatible API with AIStore. To be used with caution.
func S2UnixNano ¶
func StrSlicesEqual ¶
StrSlicesEqual compares content of two string slices. It is replacement for reflect.DeepEqual because the latter returns false if slices have the same values but in different order.
func StringInSlice ¶
func SupportedChecksums ¶
func SupportedChecksums() (types []string)
func UnixNano2S ¶
func UnwrapSyscallErr ¶
func ValidateCksumType ¶
func ValidateDaemonID ¶
func WdsKey ¶ added in v1.3.23
WebDataset convention - not to confuse with filepath.Base (!) * see https://github.com/webdataset/webdataset#the-webdataset-format
Types ¶
type Buffer ¶ added in v1.3.23
type Buffer struct {
// contains filtered or unexported fields
}
writers
type ByteHandle ¶
ByteHandle is a byte buffer(made from []byte) that implements ReadOpenCloser interface
func NewByteHandle ¶
func NewByteHandle(bt []byte) *ByteHandle
func (*ByteHandle) Close ¶
func (*ByteHandle) Close() error
func (*ByteHandle) Open ¶
func (b *ByteHandle) Open() (ReadOpenCloser, error)
type BytePack ¶
type BytePack struct {
// contains filtered or unexported fields
}
func (*BytePack) WriteBytes ¶
func (*BytePack) WriteInt16 ¶
func (*BytePack) WriteInt32 ¶
func (*BytePack) WriteInt64 ¶
func (*BytePack) WriteMapStrUint16 ¶
func (bw *BytePack) WriteMapStrUint16(mp MapStrUint16)
func (*BytePack) WriteString ¶
func (*BytePack) WriteUint16 ¶
func (*BytePack) WriteUint32 ¶
func (*BytePack) WriteUint64 ¶
type ByteUnpack ¶
type ByteUnpack struct {
// contains filtered or unexported fields
}
func NewUnpacker ¶
func NewUnpacker(buf []byte) *ByteUnpack
func (*ByteUnpack) Bytes ¶
func (br *ByteUnpack) Bytes() []byte
func (*ByteUnpack) Len ¶
func (br *ByteUnpack) Len() int
func (*ByteUnpack) ReadAny ¶
func (br *ByteUnpack) ReadAny(st Unpacker) error
func (*ByteUnpack) ReadBool ¶
func (br *ByteUnpack) ReadBool() (bool, error)
func (*ByteUnpack) ReadByte ¶
func (br *ByteUnpack) ReadByte() (byte, error)
func (*ByteUnpack) ReadBytes ¶
func (br *ByteUnpack) ReadBytes() ([]byte, error)
func (*ByteUnpack) ReadInt16 ¶
func (br *ByteUnpack) ReadInt16() (int16, error)
func (*ByteUnpack) ReadInt32 ¶
func (br *ByteUnpack) ReadInt32() (int32, error)
func (*ByteUnpack) ReadInt64 ¶
func (br *ByteUnpack) ReadInt64() (int64, error)
func (*ByteUnpack) ReadMapStrUint16 ¶
func (br *ByteUnpack) ReadMapStrUint16() (MapStrUint16, error)
func (*ByteUnpack) ReadString ¶
func (br *ByteUnpack) ReadString() (string, error)
func (*ByteUnpack) ReadUint16 ¶
func (br *ByteUnpack) ReadUint16() (uint16, error)
func (*ByteUnpack) ReadUint32 ¶
func (br *ByteUnpack) ReadUint32() (uint32, error)
func (*ByteUnpack) ReadUint64 ¶
func (br *ByteUnpack) ReadUint64() (uint64, error)
type CallbackROC ¶
type CallbackROC struct {
// contains filtered or unexported fields
}
readers: implementations
func NewCallbackReadOpenCloser ¶
func NewCallbackReadOpenCloser(r ReadOpenCloser, readCb func(int, error), reportedBytes ...int) *CallbackROC
func (*CallbackROC) Close ¶
func (r *CallbackROC) Close() error
func (*CallbackROC) Open ¶
func (r *CallbackROC) Open() (ReadOpenCloser, error)
type Cksum ¶
type Cksum struct {
// contains filtered or unexported fields
}
func ChecksumBytes ¶
ChecksumBytes computes checksum of given bytes using additional buffer.
func (*Cksum) MarshalJSON ¶
type CksumHash ¶
func CopyAndChecksum ¶
func CopyAndChecksum(w io.Writer, r io.Reader, buf []byte, cksumType string) (n int64, cksum *CksumHash, err error)
CopyAndChecksum reads from `r` and writes to `w`; returns num bytes copied and checksum, or error
func CopyFile ¶
func CopyFile(src, dst string, buf []byte, cksumType string) (written int64, cksum *CksumHash, err error)
and computes checksum if requested
func NewCksumHash ¶
type CksumHashSize ¶
type DynSemaphore ¶
type DynSemaphore struct {
// contains filtered or unexported fields
}
DynSemaphore implements sempahore which can change its size during usage.
func NewDynSemaphore ¶
func NewDynSemaphore(n int) *DynSemaphore
func (*DynSemaphore) Acquire ¶
func (s *DynSemaphore) Acquire(cnts ...int)
func (*DynSemaphore) Release ¶
func (s *DynSemaphore) Release(cnts ...int)
func (*DynSemaphore) SetSize ¶
func (s *DynSemaphore) SetSize(n int)
func (*DynSemaphore) Size ¶
func (s *DynSemaphore) Size() int
type ErrBadCksum ¶
type ErrBadCksum struct {
// contains filtered or unexported fields
}
in-cluster checksum validation (compare with cmn.ErrInvalidCksum)
func (*ErrBadCksum) Error ¶
func (e *ErrBadCksum) Error() string
type ErrNotFound ¶ added in v1.3.18
type ErrNotFound struct {
// contains filtered or unexported fields
}
func NewErrNotFound ¶ added in v1.3.18
func NewErrNotFound(where fmt.Stringer, what string) *ErrNotFound
func (*ErrNotFound) Error ¶ added in v1.3.18
func (e *ErrNotFound) Error() string
type ErrSignal ¶
type ErrSignal struct {
// contains filtered or unexported fields
}
func NewSignalError ¶
type FileHandle ¶
handles (and even more readers)
func NewFileHandle ¶
func NewFileHandle(fqn string) (*FileHandle, error)
func (*FileHandle) Open ¶
func (f *FileHandle) Open() (ReadOpenCloser, error)
type FileSectionHandle ¶
type FileSectionHandle struct {
// contains filtered or unexported fields
}
FileSectionHandle opens a file and reads a section of it with optional padding. It implements the ReadOpenCloser interface.
func NewFileSectionHandle ¶
func NewFileSectionHandle(fqn string, offset, size int64) (*FileSectionHandle, error)
NewFileSectionHandle opens file which is expected at `fqn` and defines a SectionHandle on it to only read a specified section.
func (*FileSectionHandle) Close ¶
func (f *FileSectionHandle) Close() error
func (*FileSectionHandle) Open ¶
func (f *FileSectionHandle) Open() (ReadOpenCloser, error)
type FsID ¶
type FsID [2]int32
FsID is unified and cross-platform syscall.Fsid type which implements JSON marshaling.
func (FsID) MarshalJSON ¶
func (*FsID) UnmarshalJSON ¶
type JSONRawMsgs ¶
type JSONRawMsgs map[string]jsoniter.RawMessage
type LimitedWaitGroup ¶
type LimitedWaitGroup struct {
// contains filtered or unexported fields
}
LimitedWaitGroup is helper struct which combines standard wait group and semaphore to limit the number of goroutines created.
func (*LimitedWaitGroup) Add ¶
func (lwg *LimitedWaitGroup) Add(n int)
func (*LimitedWaitGroup) Done ¶
func (lwg *LimitedWaitGroup) Done()
func (*LimitedWaitGroup) Wait ¶
func (lwg *LimitedWaitGroup) Wait()
type LomReader ¶ added in v1.3.24
type LomReader interface { io.ReadCloser io.ReaderAt }
readers: interfaces
type LomWriter ¶ added in v1.3.24
type LomWriter interface { io.WriteCloser Sync() error }
readers: interfaces
type MapStrUint16 ¶
type MultiSyncMap ¶
type MultiSyncMap struct {
M [MultiSyncMapCount]sync.Map
}
type NamedVal64 ¶
type NodeStateFlags ¶ added in v1.3.23
type NodeStateFlags BitFlags
func (NodeStateFlags) Clear ¶ added in v1.3.23
func (f NodeStateFlags) Clear(flags NodeStateFlags) NodeStateFlags
func (NodeStateFlags) IsOK ¶ added in v1.3.24
func (f NodeStateFlags) IsOK() bool
func (NodeStateFlags) IsRed ¶ added in v1.3.24
func (f NodeStateFlags) IsRed() bool
func (NodeStateFlags) IsSet ¶ added in v1.3.23
func (f NodeStateFlags) IsSet(flag NodeStateFlags) bool
func (NodeStateFlags) IsWarn ¶ added in v1.3.24
func (f NodeStateFlags) IsWarn() bool
func (NodeStateFlags) Set ¶ added in v1.3.23
func (f NodeStateFlags) Set(flags NodeStateFlags) NodeStateFlags
func (NodeStateFlags) String ¶ added in v1.3.24
func (f NodeStateFlags) String() string
type NodeStateInfo ¶ added in v1.3.23
type NodeStateInfo struct { Smap struct { Primary struct { PubURL string `json:"pub_url"` CtrlURL string `json:"control_url"` ID string `json:"id"` } Version int64 `json:"version,string"` UUID string `json:"uuid"` } `json:"smap"` BMD struct { UUID string `json:"uuid"` Version int64 `json:"version,string"` } `json:"bmd"` RMD struct { Version int64 `json:"version,string"` } `json:"rmd"` Config struct { Version int64 `json:"version,string"` } `json:"config"` EtlMD struct { Version int64 `json:"version,string"` } `json:"etlmd"` Flags NodeStateFlags `json:"flags"` }
func (*NodeStateInfo) SmapEqual ¶ added in v1.3.23
func (nsti *NodeStateInfo) SmapEqual(other *NodeStateInfo) (ok bool)
func (*NodeStateInfo) String ¶ added in v1.3.23
func (nsti *NodeStateInfo) String() string
type ParsedQuantity ¶
func ParseQuantity ¶
func ParseQuantity(quantity string) (ParsedQuantity, error)
func (ParsedQuantity) String ¶
func (pq ParsedQuantity) String() string
type ParsedTemplate ¶
type ParsedTemplate struct { Prefix string Ranges []TemplateRange // contains filtered or unexported fields }
func NewParsedTemplate ¶
func NewParsedTemplate(template string) (parsed ParsedTemplate, err error)
func ParseAtTemplate ¶
func ParseAtTemplate(template string) (pt ParsedTemplate, err error)
e.g.: - multi range: "prefix-@00001-gap-@100-suffix" - single range: "prefix@00100suffix"
func ParseBashTemplate ¶
func ParseBashTemplate(template string) (pt ParsedTemplate, err error)
examples - single-range: "prefix{0001..0010}suffix" - multi-range: "prefix-{00001..00010..2}-gap-{001..100..2}-suffix" (both prefix and suffix are optional, here and elsewhere)
func ParseFmtTemplate ¶
func ParseFmtTemplate(template string) (pt ParsedTemplate, err error)
template: "prefix-%06d-suffix" (both prefix and suffix are optional, here and elsewhere)
func (*ParsedTemplate) Clone ¶ added in v1.3.22
func (pt *ParsedTemplate) Clone() *ParsedTemplate
func (*ParsedTemplate) Count ¶
func (pt *ParsedTemplate) Count() int64
func (*ParsedTemplate) InitIter ¶
func (pt *ParsedTemplate) InitIter()
func (*ParsedTemplate) Next ¶
func (pt *ParsedTemplate) Next() (string, bool)
func (*ParsedTemplate) ToSlice ¶
func (pt *ParsedTemplate) ToSlice(maxLen ...int) []string
maxLen specifies maximum objects to be returned
type ReadCloseSizer ¶
type ReadCloseSizer interface { io.ReadCloser Size() int64 }
readers: interfaces
func NewDeferRCS ¶
func NewDeferRCS(r ReadCloseSizer, cb func()) ReadCloseSizer
type ReadOpenCloseSizer ¶
type ReadOpenCloseSizer interface { ReadOpenCloser Size() int64 }
readers: interfaces
type ReadOpenCloser ¶
type ReadOpenCloser interface { io.ReadCloser Open() (ReadOpenCloser, error) }
readers: interfaces
func NopOpener ¶
func NopOpener(r io.ReadCloser) ReadOpenCloser
type ReadWrapperFunc ¶
type ReadWrapperFunc func(r io.ReadCloser) io.ReadCloser
type ReaderArgs ¶
readers: implementations
type ReaderWithArgs ¶
type ReaderWithArgs struct {
// contains filtered or unexported fields
}
readers: implementations
func NewReaderWithArgs ¶
func NewReaderWithArgs(args ReaderArgs) *ReaderWithArgs
func (*ReaderWithArgs) Close ¶
func (r *ReaderWithArgs) Close() (err error)
func (*ReaderWithArgs) Open ¶
func (*ReaderWithArgs) Open() (ReadOpenCloser, error)
func (*ReaderWithArgs) Size ¶
func (r *ReaderWithArgs) Size() int64
type SectionHandle ¶
type SectionHandle struct {
// contains filtered or unexported fields
}
SectionHandle is a section of reader with optional padding that implements ReadOpenCloser interface.
func NewSectionHandle ¶
func NewSectionHandle(r io.ReaderAt, offset, size, padding int64) *SectionHandle
func (*SectionHandle) Close ¶
func (*SectionHandle) Close() error
func (*SectionHandle) Open ¶
func (f *SectionHandle) Open() (ReadOpenCloser, error)
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is a textbook _sempahore_ implemented as a wrapper on `chan struct{}`.
func NewSemaphore ¶
func (*Semaphore) TryAcquire ¶
func (s *Semaphore) TryAcquire() <-chan struct{}
type SetSizeFunc ¶
type SetSizeFunc func(size int64)
type SimpleOAH ¶ added in v1.3.18
convenience/shortcut
func (SimpleOAH) GetCustomKey ¶ added in v1.3.18
func (SimpleOAH) GetCustomMD ¶ added in v1.3.18
func (SimpleOAH) SetCustomKey ¶ added in v1.3.18
func (SimpleOAH) VersionPtr ¶ added in v1.3.24
type SizeIEC ¶ added in v1.3.16
type SizeIEC int64
func (SizeIEC) MarshalJSON ¶ added in v1.3.16
func (*SizeIEC) UnmarshalJSON ¶ added in v1.3.16
type StatsUpdater ¶ added in v1.3.16
type StatsUpdater interface { Inc(name string) Add(name string, val int64) SetFlag(name string, set NodeStateFlags) ClrFlag(name string, clr NodeStateFlags) SetClrFlag(name string, set, clr NodeStateFlags) Get(name string) int64 AddMany(namedVal64 ...NamedVal64) }
type StopCh ¶
type StopCh struct {
// contains filtered or unexported fields
}
StopCh is a channel for stopping running things.
type StrKVs ¶
func (StrKVs) ContainsAnyMatch ¶
type TemplateRange ¶
type TimeoutGroup ¶
type TimeoutGroup struct {
// contains filtered or unexported fields
}
TimeoutGroup is similar to sync.WaitGroup with the difference on Wait where we only allow timing out.
WARNING: It should not be used in critical code as it may have worse performance than sync.WaitGroup - use only if its needed.
WARNING: It is not safe to wait on completion in multiple threads!
WARNING: It is not recommended to reuse the TimeoutGroup - it was not designed for that and bugs can be expected, especially when previous group was not called with successful (without timeout) WaitTimeout.
func NewTimeoutGroup ¶
func NewTimeoutGroup() *TimeoutGroup
func (*TimeoutGroup) Add ¶
func (twg *TimeoutGroup) Add(n int)
func (*TimeoutGroup) Done ¶
func (twg *TimeoutGroup) Done()
Done decrements number of jobs left to do. Panics if the number jobs left is less than 0.
func (*TimeoutGroup) Wait ¶
func (twg *TimeoutGroup) Wait()
Wait waits until the Added pending count goes to zero. NOTE: must be invoked after _all_ Adds.
func (*TimeoutGroup) WaitTimeout ¶
func (twg *TimeoutGroup) WaitTimeout(timeout time.Duration) bool
Wait waits until the Added pending count goes to zero _or_ timeout. NOTE: must be invoked after _all_ Adds.
func (*TimeoutGroup) WaitTimeoutWithStop ¶
func (twg *TimeoutGroup) WaitTimeoutWithStop(timeout time.Duration, stop <-chan struct{}) (timed, stopped bool)
Wait waits until the Added pending count goes to zero _or_ timeout _or_ stop. NOTE: must be invoked after _all_ Adds.
type Unpacker ¶
type Unpacker interface {
Unpack(unpacker *ByteUnpack) error
}
Every object that is going to use binary representation instead of JSON must implement two following methods
type WG ¶
type WG interface { Add(int) Done() Wait() }
WG is an interface for wait group
func NewLimitedWaitGroup ¶
usage: no more than `limit` (e.g., sys.NumCPU()) goroutines in parallel
type WriterMulti ¶
type WriterMulti struct {
// contains filtered or unexported fields
}
writers
func NewWriterMulti ¶
func NewWriterMulti(w ...io.Writer) *WriterMulti
type WriterOnly ¶
WriterOnly is a helper struct to hide `io.ReaderFrom` interface implementation As far as http.ResponseWriter (and its underlying tcp conn.), the following are tradeoffs: [-] sendfile (when sending), or [-] copy_file_range (when writing local files) [+] use (reusable) buffer, reduce code path, reduce locking
Source Files ¶
- assert.go
- basename.go
- bitflags.go
- bytepack.go
- cksum.go
- context.go
- convert.go
- duration.go
- env_vars.go
- err.go
- err_linux.go
- exit.go
- fs.go
- fs_unix.go
- homedir.go
- http_headers.go
- io.go
- ioutils.go
- json.go
- log.go
- log_module.go
- math.go
- namedrunner.go
- node_state.go
- oah.go
- oom.go
- quantity.go
- rand.go
- setkvs.go
- size.go
- slice.go
- stats.go
- strings.go
- sync.go
- template.go
- time_utils.go
- unsafe.go
- url.go
- uuid.go