Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableLocalAddress

func GetAvailableLocalAddress(t *testing.T) string

    GetAvailableLocalAddress finds an available local port and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

    func GetAvailablePort

    func GetAvailablePort(t *testing.T) uint16

      GetAvailablePort finds an available local port and returns it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

      func TempSocketName

      func TempSocketName(t *testing.T) string

        TempSocketName provides a temporary Unix socket name for testing.

        Types

        type LimitedWriter

        type LimitedWriter struct {
        	bytes.Buffer
        	MaxLen int
        }

          LimitedWriter is an io.Writer that will return an EOF error after MaxLen has been reached. If MaxLen is 0, Writes will always succeed.

          func (*LimitedWriter) Close

          func (lw *LimitedWriter) Close() error

            Close closes the writer.

            func (*LimitedWriter) Write

            func (lw *LimitedWriter) Write(p []byte) (n int, err error)

              Write writes bytes to the underlying buffer until reaching the maximum length.

              Source Files

              Directories

              Path Synopsis