io

package
v1.20.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 422

Documentation

Overview

Package io provides utilities for Smithy generated API clients.

Index

Constants

View Source
const (
	// Byte is 8 bits
	Byte int64 = 1
	// KibiByte (KiB) is 1024 Bytes
	KibiByte = Byte * 1024
	// MebiByte (MiB) is 1024 KiB
	MebiByte = KibiByte * 1024
	// GibiByte (GiB) is 1024 MiB
	GibiByte = MebiByte * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadSeekNopCloser

type ReadSeekNopCloser struct {
	io.ReadSeeker
}

ReadSeekNopCloser wraps an io.ReadSeeker with an additional Close method that does nothing.

func (ReadSeekNopCloser) Close

func (ReadSeekNopCloser) Close() error

Close does nothing.

type RingBuffer

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

RingBuffer struct satisfies io.ReadWrite interface.

ReadBuffer is a revolving buffer data structure, which can be used to store snapshots of data in a revolving window.

func NewRingBuffer

func NewRingBuffer(slice []byte) *RingBuffer

NewRingBuffer method takes in a byte slice as an input and returns a RingBuffer.

func (RingBuffer) Bytes

func (r RingBuffer) Bytes() []byte

Bytes returns a copy of the RingBuffer's bytes.

func (*RingBuffer) Len added in v1.3.1

func (r *RingBuffer) Len() int

Len returns the number of unread bytes in the buffer.

func (*RingBuffer) Read

func (r *RingBuffer) Read(p []byte) (int, error)

Read copies the data on the ring buffer into the byte slice provided to the method. Returns the read count along with any error encountered while reading.

func (*RingBuffer) Reset

func (r *RingBuffer) Reset()

Reset resets the ring buffer.

func (*RingBuffer) Write

func (r *RingBuffer) Write(p []byte) (int, error)

Write method inserts the elements in a byte slice, and returns the number of bytes written along with any error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL