mockappcontainer

package
v1.0.442 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 4 Imported by: 0

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