apiconfig

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyLatest = fmt.Errorf("already latest version")

ErrAlreadyLatest indicates the current version is already the latest

View Source
var Version = "dev"

Version information

Functions

func GetVersion added in v0.2.1

func GetVersion() string

GetVersion returns the version with "v" prefix if not already present

Types

type Config

type Config struct {
	Keys           []string
	LinkTestModel  string
	ValidTestModel []string
	Type           types.ChannelType
	URL            string
	ImageURL       string
}

Config represents API configuration

func GetLinkConfig

func GetLinkConfig(reader io.Reader) (*Config, error)

GetLinkConfig is a convenience function for link detection mode

type ConfigReader

type ConfigReader struct {
	Printer *util.Printer
	// 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) CheckUpdate

func (r *ConfigReader) CheckUpdate() (bool, error)

CheckUpdate checks for updates and prompts the user to update if a new version is available

func (*ConfigReader) PrintModelMenu

func (r *ConfigReader) PrintModelMenu(title string, models []string, modelGroup []config.ModelGroup)

func (*ConfigReader) ReadLinkConfig

func (r *ConfigReader) ReadLinkConfig() (*Config, error)

ReadLinkConfig reads configuration for link detection

func (*ConfigReader) ReadValidTestConfig

func (r *ConfigReader) ReadValidTestConfig() (*Config, error)

ReadConfig reads API configuration from user input

func (*ConfigReader) ShowConfig

func (r *ConfigReader) ShowConfig(cfg *Config)

ShowConfig displays the configuration information

type GithubRelease

type GithubRelease struct {
	TagName string `json:"tag_name"`
}

Jump to

Keyboard shortcuts

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