mockutil

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright (c) 2016-2019 Uber Technologies, 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReaderMatcher

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

ReaderMatcher is a gomock Matcher which matches io.Readers which produce some given bytes.

func MatchReader

func MatchReader(expected []byte) *ReaderMatcher

MatchReader returns a new ReaderMatcher which matches expected.

func (*ReaderMatcher) Matches

func (m *ReaderMatcher) Matches(x interface{}) bool

Matches returns true if x is an io.Reader which contains the expected bytes.

func (*ReaderMatcher) String

func (m *ReaderMatcher) String() string

type RegexMatcher

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

RegexMatcher is a gomock Matcher which matches strings against some given regex.

func MatchRegex

func MatchRegex(expected string) *RegexMatcher

MatchRegex returns a new RegexMatcher which matches the expected regex.

func (*RegexMatcher) Matches

func (m *RegexMatcher) Matches(x interface{}) bool

Matches returns true if x is a string which matches the expected regex.

func (*RegexMatcher) String

func (m *RegexMatcher) String() string

type WriterAtMatcher

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

WriterAtMatcher is a gomock Matcher which matches any io.WriterAt, with the side-effect of writing some give bytes.

func MatchWriterAt

func MatchWriterAt(b []byte) *WriterAtMatcher

MatchWriterAt returns a new WriterAtMatcher which writes b to any io.WriterAt passed to Matches.

func (*WriterAtMatcher) Matches

func (m *WriterAtMatcher) Matches(x interface{}) bool

Matches writes given bytes to x.

func (*WriterAtMatcher) String

func (m *WriterAtMatcher) String() string

type WriterMatcher

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

WriterMatcher is a gomock Matcher which matches any io.Writer, with the side-effect of writing some given bytes.

func MatchWriter

func MatchWriter(b []byte) *WriterMatcher

MatchWriter returns a new WriterMatcher which write b to any io.Writer passed to Matches.

func (*WriterMatcher) Matches

func (m *WriterMatcher) Matches(x interface{}) bool

Matches writes given bytes to x.

func (*WriterMatcher) String

func (m *WriterMatcher) String() string

Jump to

Keyboard shortcuts

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