Documentation ¶
Overview ¶
Copyright 2023 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotSlice = errors.New("value is not a slice") ErrInvalidType = errors.New("invalid type") )
Functions ¶
func ElemInSlice ¶
ElemInSlice is a generic function for comparing a value with all elements in a slice.
Types ¶
type KeyValParser ¶
type KeyValParser struct {
// contains filtered or unexported fields
}
KeyValParser is a parser that reading lines in format 'key=value\n'. Entries collected during parsing and can be retrieved by calling KeyValParser.Collect(). Keys appearing multiple times will have their values merged into a single list.
func (*KeyValParser) Collect ¶
func (k *KeyValParser) Collect() map[string][]string
Collect() data read during Parse(). Map keys correspond to entry names, while map values is a list of entry values collected for particular key.
For instance, input:
foo=bar baz=1 baz=zen
will be converted to:
map[string][]string{ "foo": []string{"bar"}, "baz": []string{"1", "zen"} }
If no data was collected during Parse(), returns nil. A non-nil may be returned regardless of errors reported byParse(), in such case, the data will contain entries collected up to a point when error was detected.
type LimitedWriteCloser ¶
type LimitedWriteCloser struct { W io.WriteCloser // underlying resource N uint64 // number of bytes remaining }
func (*LimitedWriteCloser) Close ¶
func (lw *LimitedWriteCloser) Close() error
type ProgressWriter ¶
type ProgressWriter struct {
// contains filtered or unexported fields
}
func NewProgressWriter ¶
func NewProgressWriter(size int64) *ProgressWriter
func (*ProgressWriter) Tick ¶
func (p *ProgressWriter) Tick(n uint64)