Documentation
¶
Overview ¶
Copyright Consensys Software Inc.
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.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
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.
SPDX-License-Identifier: Apache-2.0
Index ¶
- func ReadAndUncompress(filename string) (string, []byte, error)
- func ReadInputFileAsLines(filename string) []string
- type Path
- func (p *Path) Compare(other Path) int
- func (p *Path) Dehead() *Path
- func (p *Path) Depth() uint
- func (p *Path) Equals(other Path) bool
- func (p *Path) Extend(tail string) *Path
- func (p *Path) Get(nth uint) string
- func (p *Path) GobDecode(data []byte) error
- func (p *Path) GobEncode() (data []byte, err error)
- func (p *Path) Head() string
- func (p *Path) IsAbsolute() bool
- func (p *Path) Parent() *Path
- func (p *Path) PrefixOf(other Path) bool
- func (p *Path) PushRoot(tail string) *Path
- func (p *Path) Slice(start uint) *Path
- func (p *Path) String() string
- func (p *Path) Tail() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAndUncompress ¶
ReadAndUncompress reads a given file and, if its extension indicates it is compressed, then it decompresses it before returning the decompressed byte and the underlying filename (e.g. if original filename was "file.lt.gz" then it returns "file.lt"). Supported compression formats are "bz2" and "gz".
func ReadInputFileAsLines ¶
ReadInputFileAsLines reads an input file as a sequence of lines.
Types ¶
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a construct for describing paths through trees. A path can be either *absolute* or *relative*. An absolute path always starts from the root of the tree, whilst a relative path can begin from any point within the tree.
func NewAbsolutePath ¶
NewAbsolutePath constructs a new absolute path from the given segments.
func NewRelativePath ¶
NewRelativePath constructs a new absolute path from the given segments.
func (*Path) Dehead ¶
Dehead removes the head from this path, returning an otherwise identical path. Observe that, if this were absolute, it is no longer!
func (*Path) IsAbsolute ¶
IsAbsolute determines whether or not this is an absolute path.
func (*Path) PushRoot ¶
PushRoot converts a relative path into an absolute path by pushing the "root" of the tree onto the head (i.e. outermost) position.