api

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInput

func ParseInput(input string) (url, key string, err error)

ParseInput parses input string to extract URL and Key

Types

type Config

type Config struct {
	URL   string
	Key   string
	Model string
}

Config represents API configuration

func GetConfig

func GetConfig(reader io.Reader, defaultModel string) (*Config, error)

GetConfig is a convenience function that creates a ConfigReader with stdout

func GetConfigQuiet

func GetConfigQuiet(reader io.Reader, defaultModel string) (*Config, error)

GetConfigQuiet is a convenience function that creates a ConfigReader with no output

type ConfigReader

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

ConfigReader handles the configuration reading process

func NewConfigReader

func NewConfigReader(input io.Reader, output io.Writer) *ConfigReader

NewConfigReader creates a new ConfigReader

func (*ConfigReader) ReadConfig

func (r *ConfigReader) ReadConfig(defaultModel string) (*Config, error)

ReadConfig reads the configuration

Jump to

Keyboard shortcuts

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