config

package
v0.0.1-release Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "dev-0.0.1"
)

Version TODO: generate that automatically

Variables

This section is empty.

Functions

This section is empty.

Types

type CliConfig

type CliConfig struct {
	LogLevel string
	Rich     bool

	Proxy   string
	WssLink string

	Style   string
	Prompt  string
	Context string
	Locale  string

	DaLLe struct {
		ApiURL  string
		UCookie string
	}
}

type Config

func NewFromCLI

func NewFromCLI(cfg CliConfig) Config

func NewFromFile

func NewFromFile(path string) Config

func NewFromGPTConfig

func NewFromGPTConfig(cfg YamlGPTConfig) Config

type Logger

type Logger interface {
	Logging() *logrus.Entry
}

func NewLogger

func NewLogger(lvl string) Logger

type Networker

type Networker interface {
	Proxy() *url.URL
	WssLink() string
	dallecfg.Networker
}

func NewNetworker

func NewNetworker(apiUrl, proxy, wssLink string) Networker

type Prompter

type Prompter interface {
	Style() string
	InitialPrompt() string
	Context() string
	Locale() string
	Language() string
}

func NewPrompter

func NewPrompter(style, prompt, context, locale string) Prompter

type Runtime

type Runtime interface {
	Version() string
	Rich() bool
}

func NewRuntime

func NewRuntime(version string, rich bool) Runtime

type YamlGPTConfig

type YamlGPTConfig struct {
	LogLevel string `yaml:"log_level"`
	Rich     bool   `yaml:"rich"`

	Proxy   string `yaml:"proxy"`
	WssLink string `yaml:"wss_link"`

	Style   string `yaml:"style"`
	Prompt  string `yaml:"prompt"`
	Context string `yaml:"context"`
	Locale  string `yaml:"locale"`

	DaLLe dallecfg.YamlDALLEConfig `yaml:"dalle"`
}

Jump to

Keyboard shortcuts

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