kfx

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnapsackClientModule = fx.Provide(
	func(
		setting KnapsackSettingParams,
		sSetting sfx.SecuritySettingsParams,
	) (out KnapsackClientResult, err error) {
		if cli, e := NewKnapsackClient(setting.KnapsackUrl, sSetting); e != nil {
			err = e
		} else {
			out.KnapsackClient = cli
		}
		if cli, e := NewKnapsackPrivateClient(setting.KnapsackUrl, sSetting); e != nil {
			err = e
		} else {
			out.KnapsackPrivateClient = cli
		}
		return
	},
)
View Source
var SettingsModule = fx.Provide(
	func() (out KnapsackSettingsResult, err error) {
		err = out.LoadFromEnv()
		return
	},
)

Functions

func NewKnapsackClient

func NewKnapsackClient(host string, sSetting sfx.SecuritySettingsParams) (pb.KnapsackServiceClient, error)

func NewKnapsackPrivateClient

func NewKnapsackPrivateClient(host string, sSetting sfx.SecuritySettingsParams) (pb.KnapsackPrivateServiceClient, error)

Types

type KnapsackClientParams

type KnapsackClientParams struct {
	fx.In

	KnapsackClient        pb.KnapsackServiceClient        `name:"KnapsackClient"`
	KnapsackPrivateClient pb.KnapsackPrivateServiceClient `name:"KnapsackPrivateClient"`
}

type KnapsackClientResult

type KnapsackClientResult struct {
	fx.Out

	KnapsackClient        pb.KnapsackServiceClient        `name:"KnapsackClient"`
	KnapsackPrivateClient pb.KnapsackPrivateServiceClient `name:"KnapsackPrivateClient"`
}

type KnapsackSettingParams

type KnapsackSettingParams struct {
	fx.In

	KnapsackUrl       string `name:"KnapsackUrl"`
	KnapsackStoreName string `name:"KnapsackStoreName"`
}

type KnapsackSettingsResult

type KnapsackSettingsResult struct {
	fx.Out

	KnapsackStoreName string `name:"KnapsackStoreName" envconfig:"KNAPSACK_STORE_NAME" default:"knapsack"`
	KnapsackUrl       string `name:"KnapsackUrl" envconfig:"KNAPSACK_URL" default:"localhost:8081"`
}

func (*KnapsackSettingsResult) LoadFromEnv

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

Jump to

Keyboard shortcuts

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