package and

import "github.com/google/go-containerregistry/internal/and"

Package and provides helpers for adding Close to io.{Reader|Writer}.

Index

Types

type ReadCloser

type ReadCloser struct {
	io.Reader
	CloseFunc func() error
}

ReadCloser implements io.ReadCloser by reading from a particular io.Reader and then calling the provided "Close()" method.

func (*ReadCloser) Close

func (rac *ReadCloser) Close() error

Close implements io.ReadCloser

type WriteCloser

type WriteCloser struct {
	io.Writer
	CloseFunc func() error
}

WriteCloser implements io.WriteCloser by reading from a particular io.Writer and then calling the provided "Close()" method.

func (*WriteCloser) Close

func (wac *WriteCloser) Close() error

Close implements io.WriteCloser

Source Files

and_closer.go

Version
v0.20.3 (latest)
Published
Jan 15, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
21 hours ago

Tools for package owners.