mock

package
v0.0.0-...-6d2f78d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mock provides implementations for mocking objects and endpoints for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMirrorRoundTripper

func NewMirrorRoundTripper() http.RoundTripper

NewMirrorRoundTripper returns an http.RoundTripper that mirrors the request body in the response body.

func NewSession

func NewSession() (*discordgo.Session, error)

NewSession provides a *discordgo.Session instance to be used in unit testing with pre-populated initial state.

Types

type Logger

type Logger struct {
	*logrus.Logger
}

Logger is a mock logger to suppress printing any actual log messages.

func NewLogger

func NewLogger() *Logger

NewLogger provides mock *Logger instance.

func (*Logger) DiscordGoLogf

func (*Logger) DiscordGoLogf(_, _ int, _ string, _ ...interface{})

DiscordGoLogf is a mock stub of the *logging.Logger DiscordGoLogf method.

func (*Logger) UpdateDiscordrus

func (*Logger) UpdateDiscordrus()

UpdateDiscordrus is a mock stub of the *logging.Logger UpdateDiscordrus method.

func (*Logger) UpdateLevel

func (*Logger) UpdateLevel(_ string)

UpdateLevel is a mock stub of the *logging.Logger UpdateLevel method.

func (*Logger) WrappedLogger

func (logger *Logger) WrappedLogger() *logrus.Logger

WrappedLogger returns the wrapped *logrus.Logger instance.

Jump to

Keyboard shortcuts

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