Documentation

Overview

    Package util contains internal routines used by the styx packages.

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func IsTempErr

    func IsTempErr(err error) bool

      IsTempErr returns true if an error exports a Temporary() method that returns true.

      Types

      type BlackHole

      type BlackHole struct{}

        A BlackHole is an io.ReadWriteCloser that accepts an infinite amount of input and produces no output.

        func (BlackHole) Close

        func (BlackHole) Close() error

        func (BlackHole) Read

        func (BlackHole) Read(p []byte) (int, error)

        func (BlackHole) Write

        func (BlackHole) Write(p []byte) (int, error)

        type RefCount

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

          A Refcount can be embedded in structures to provide reference-counting of resources.

          Example
          Output:
          
          

          func (*RefCount) DecRef

          func (r *RefCount) DecRef() (remaining bool)

            DecRef decrements refcount by 1. If the reference count has reached 0, DecRef will return false.

            func (*RefCount) IncRef

            func (r *RefCount) IncRef()

              IncRef increments refcount by 1. It is a run-time panic to create more than ^uint64(0) references.

              type SectionWriter

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

                Section writer provides a partial analogue io.SectionReader, for writers.

                func NewSectionWriter

                func NewSectionWriter(w io.WriterAt, off, n int64) *SectionWriter

                func (*SectionWriter) Write

                func (s *SectionWriter) Write(p []byte) (int, error)