Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSlogAdapter ¶
func NewSlogAdapter(stub *StubLogger) *slog.Logger
Types ¶
type Logger ¶
type Logger interface {
Info(msg string, keysAndValues ...interface{})
}
———————————————————————————— 1. Define the abstraction used by production code ————————————————————————————
type Person ¶
type Person struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
}
func GenerateFakePerson ¶
func GenerateFakePerson() Person
func GeneratePeople ¶
type StubLogger ¶
type StubLogger struct {
// contains filtered or unexported fields
}
———————————————————————————— 2. A lightweight stub that records calls ————————————————————————————
func (*StubLogger) Info ¶
func (s *StubLogger) Info(msg string, keysAndValues ...interface{})
Click to show internal directories.
Click to hide internal directories.