model

package
v0.0.0-...-efaf3d2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ProvideBar

func ProvideBar(f Fooer) string

provideBar Barを返す。 引数はFooerインタフェースを渡すが実際はMyFooer

Types

type Animal

type Animal interface {
	Bark() string
	Walk() int
}

type Bar

type Bar string

type Cat

type Cat struct {
	X int
}

func ProvideCat

func ProvideCat() Cat

func (Cat) Bark

func (c Cat) Bark() string

func (Cat) Walk

func (c Cat) Walk() int

type Dog

type Dog struct {
	X int
}

func ProvideDog

func ProvideDog() Dog

func (Dog) Bark

func (d Dog) Bark() string

func (Dog) Walk

func (d Dog) Walk() int

type Event

type Event struct {
	Greeter Greeter
}

func NewEvent

func NewEvent(g Greeter) (Event, error)

Eventの生成。依存関係としてGreeterを持っている

func (Event) Start

func (e Event) Start()

type Fooer

type Fooer interface {
	Foo() string
}

type Greeter

type Greeter struct {
	Message Message
	Grumpy  bool
}

func NewGreeter

func NewGreeter(m Message) Greeter

Greeterを返すもの。 依存関係としてMessageを持っている

func (Greeter) Greet

func (g Greeter) Greet() Message

Greetメソッド

type Message

type Message string

func NewMessage

func NewMessage(phrasa string) Message

Messageを返すもの 依存関係なし

type MyFooer

type MyFooer string

func ProvideMyFooer

func ProvideMyFooer() *MyFooer

provideMyFooer 具体型のMyFooer(Fooerインタフェースを実装している)を返すプロバイダー

func (*MyFooer) Foo

func (b *MyFooer) Foo() string

type Owner

type Owner struct {
	Animal Animal
}

func ProvideOwner

func ProvideOwner(animal Animal) Owner

Jump to

Keyboard shortcuts

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