dfx

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SettingsModule = fx.Provide(
	func() (out SettingsResult, err error) {
		err = out.LoadFromEnv()
		return
	},
)
View Source
var SqliteDriverModule = fx.Provide(
	func(
		l *zap.Logger,
		s SettingsParams,
	) (out ofx.GormDriverResult, err error) {
		out.Dialector = sqlite.Open(s.GormDns)
		return out, nil
	},
)

Functions

This section is empty.

Types

type DemoClient

type DemoClient struct {
	// contains filtered or unexported fields
}

func NewDemoClient

func NewDemoClient(
	target string,
	secure bool,
) (result *DemoClient, err error)

func (*DemoClient) Hi

func (dc *DemoClient) Hi(ctx context.Context, message string) (string, error)

type SettingsParams

type SettingsParams struct {
	fx.In

	DemoUrl string `name:"DemoUrl"`
	DbName  string `name:"DbName"`
	GormDns string `name:"GormDns"`
}

type SettingsResult

type SettingsResult struct {
	fx.Out

	DemoUrl string `name:"DemoUrl" envconfig:"DEMO_URL" default:"localhost:8081"`
	DbName  string `name:"DbName" envconfig:"DB_NAME" default:"demo"`
	GormDns string `name:"GormDns" envconfig:"GORM_DNS" default:"demo.db"`
}

func (*SettingsResult) LoadFromEnv

func (g *SettingsResult) LoadFromEnv() (err error)

Jump to

Keyboard shortcuts

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