mockappcontainer

package
v1.1.457 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mockappcontainer builds a go.uber.org/dig container pre-populated with the dependencies gserver needs (config, JWT signer/parser, discovery), for use in tests:

c := mockappcontainer.NewBuilder().
	WithConfig(&gserver.Config{...}).
	WithJwtParser(parser).
	WithDiscovery(discovery.New()).
	Container()

Each With* call registers a provider; registering the same type twice is silently ignored by dig's error being discarded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder accumulates providers into a dig container for gserver tests.

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns a Builder over a new, empty dig container.

func (*Builder) Container

func (b *Builder) Container() *dig.Container

Container returns the underlying dig container.

func (*Builder) WithConfig

func (b *Builder) WithConfig(c *gserver.Config) *Builder

WithConfig provides *gserver.Config.

func (*Builder) WithDiscovery

func (b *Builder) WithDiscovery(d discovery.Discovery) *Builder

WithDiscovery provides discovery.Discovery.

func (*Builder) WithJwtParser

func (b *Builder) WithJwtParser(j jwt.Parser) *Builder

WithJwtParser provides jwt.Parser.

func (*Builder) WithJwtSigner

func (b *Builder) WithJwtSigner(j jwt.Signer) *Builder

WithJwtSigner provides jwt.Signer.

Jump to

Keyboard shortcuts

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