api

package
v0.0.0-...-e105d0e Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Logger           *slog.Logger
	RestConfig       *rest.Config
	DBClient         *database.Client
	RestServer       *rest.Server
	RequestTimeout   time.Duration
	Ingester         ingester.Ingester
	RateLimiter      *ratelimiter.RateLimiter
	APIKeyService    *apikey.Service
	PromptService    *prompt.Service
	ProviderService  *provider.Service
	IProviderService *iprovider.Service
}

func (*API) Start

func (api *API) Start() error

type AuthenticationConfig

type AuthenticationConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled,omitempty" mapstructure:"enabled" default:"false"`
}

type Config

type Config struct {
	Host           string               `yaml:"host" json:"host,omitempty" mapstructure:"host" default:"0.0.0.0"`
	Port           int                  `yaml:"port" json:"port,omitempty" mapstructure:"port" default:"8080"`
	RequestTimeout time.Duration        `yaml:"request_timeout" json:"request_timeout,omitempty" mapstructure:"request_timeout" default:"5s"`
	Authentication AuthenticationConfig `yaml:"authentication" mapstructure:"authentication"`
}

type Option

type Option func(*API)

Option for creating an instance of API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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