birthdaybot/server/options.go
2023-07-04 12:48:16 +02:00

22 lines
404 B
Go

package server
import (
"git.ctrlz.es/mgdelacroix/birthdaybot/model"
"github.com/charmbracelet/log"
)
type Option func(*Server) *Server
func WithConfig(config *model.Config) Option {
return func(server *Server) *Server {
server.config = config
return server
}
}
func WithLogger(logger *log.Logger) Option {
return func(server *Server) *Server {
server.Logger = logger
return server
}
}