greeting

package
v1.6.2 Latest Latest
Warning

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

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

Documentation

Overview

Package greeting provides the greeters used by the example.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Greeter

type Greeter struct {
	Prefix string
}

Greeter builds greeting lines.

func NewFormalGreeter

func NewFormalGreeter() (*Greeter, error)

NewFormalGreeter provides the greeter named "formal". @Provide(name=formal, index=0)

func NewGreeter

func NewGreeter(o *Options) *Greeter

NewGreeter provides the default greeter, whose prefix comes from config. @Provide(index=0)

func (*Greeter) Greet

func (g *Greeter) Greet(name string) string

Greet returns the greeting for name.

type Options

type Options struct {
	Prefix string `default:"Hello" desc:"opening word of the default greeting"`
}

Options configures the default greeter. inject generates its config keys (inject.examples.simple.greeting.*) and provides *Options. @Config

Jump to

Keyboard shortcuts

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