provider

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableProviders = []ProviderDefinition{
	{
		Name: "openai",
		Factory: func(configPath string) (Provider, error) {
			return openai.NewProvider(configPath)
		},
		ConfigSetter: &openai.Config{},
	},
}

Functions

This section is empty.

Types

type ConfigSetter

type ConfigSetter interface {
	Configure() (any, error)
}

ConfigSetter represents a type that can prompt for configuration.

func GetConfigSetter

func GetConfigSetter(providerName string) (ConfigSetter, error)

type Factory

type Factory func(configPath string) (Provider, error)

func GetFactory

func GetFactory(providerName string) (Factory, error)

type Provider

type Provider interface {
	GetCommitMessages(diff string, n int) ([]string, error)
}

Provider is the interface for commit message providers.

type ProviderDefinition

type ProviderDefinition struct {
	Name         string
	Factory      Factory
	ConfigSetter ConfigSetter
}

ProviderDefinition holds information about a provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳