options

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnableGalleriesAutoload = func(o *Option) {
	o.AutoloadGalleries = true
}
View Source
var EnableSingleBackend = func(o *Option) {
	o.SingleBackend = true
}

Functions

This section is empty.

Types

type AppOption

type AppOption func(*Option)

func WithApiKeys added in v1.24.1

func WithApiKeys(apiKeys []string) AppOption

func WithAudioDir

func WithAudioDir(audioDir string) AppOption

func WithBackendAssets

func WithBackendAssets(f embed.FS) AppOption

func WithBackendAssetsOutput

func WithBackendAssetsOutput(out string) AppOption

func WithConfigFile

func WithConfigFile(configFile string) AppOption

func WithContext

func WithContext(ctx context.Context) AppOption

func WithContextSize

func WithContextSize(ctxSize int) AppOption

func WithCors

func WithCors(b bool) AppOption

func WithCorsAllowOrigins

func WithCorsAllowOrigins(b string) AppOption

func WithDebug

func WithDebug(debug bool) AppOption

func WithDisableMessage

func WithDisableMessage(disableMessage bool) AppOption

func WithExternalBackend added in v1.22.0

func WithExternalBackend(name string, uri string) AppOption

func WithF16

func WithF16(f16 bool) AppOption

func WithGalleries

func WithGalleries(galleries []gallery.Gallery) AppOption

func WithImageDir

func WithImageDir(imageDir string) AppOption

func WithJSONStringPreload

func WithJSONStringPreload(configFile string) AppOption

func WithMetrics added in v1.40.0

func WithMetrics(meter *metrics.Metrics) AppOption

func WithModelLoader

func WithModelLoader(loader *model.ModelLoader) AppOption

func WithStringGalleries

func WithStringGalleries(galls string) AppOption

func WithThreads

func WithThreads(threads int) AppOption

func WithUploadLimitMB

func WithUploadLimitMB(limit int) AppOption

func WithYAMLConfigPreload

func WithYAMLConfigPreload(configFile string) AppOption

type Option

type Option struct {
	Context                             context.Context
	ConfigFile                          string
	Loader                              *model.ModelLoader
	UploadLimitMB, Threads, ContextSize int
	F16                                 bool
	Debug, DisableMessage               bool
	ImageDir                            string
	AudioDir                            string
	CORS                                bool
	PreloadJSONModels                   string
	PreloadModelsFromPath               string
	CORSAllowOrigins                    string
	ApiKeys                             []string
	Metrics                             *metrics.Metrics

	Galleries []gallery.Gallery

	BackendAssets     embed.FS
	AssetsDestination string

	ExternalGRPCBackends map[string]string

	AutoloadGalleries bool

	SingleBackend bool
}

func NewOptions

func NewOptions(o ...AppOption) *Option

Jump to

Keyboard shortcuts

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