settings

package
v0.0.0-...-d0cda72 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UIPlSettingName                  = "ui-pl"
	UISourceSettingName              = "ui-source"
	DefaultNotebookImagesSettingName = "default-notebook-images"
	DefaultRayClusterImage           = "default-ray-cluster-image"
	DefaultRayLLMImage               = "default-ray-llm-image"
	FirstLoginSettingName            = "first-login"
)

Variables

View Source
var (
	InjectDefaults string

	APIUIVersion           = NewSetting("api-ui-version", "1.1.10") // Please update the ONEBLOCK_API_UI_VERSION in Dockerfile when updating the version here.
	AuthSecretName         = NewSetting("auth-secret-name", "oneblock-key-holder")
	AuthTokenMaxTTLMinutes = NewSetting("auth-token-max-ttl-minutes", "720")
	FirstLogin             = NewSetting(FirstLoginSettingName, "true")
	ServerURL              = NewSetting("server-url", "")
	ServerVersion          = NewSetting("server-version", "dev")
	UIIndex                = NewSetting("ui-index", "https://releases.1block.ai/dashboard/latest/index.html")
	UIPath                 = NewSetting("ui-path", "/usr/share/oneblock-ai/oneblock")
	UIPl                   = NewSetting(UIPlSettingName, "oneblock")
	UISource               = NewSetting(UISourceSettingName, "auto") // Options are 'auto', 'external' or 'bundled'
	RayClusterImage        = NewSetting(DefaultRayClusterImage, "anyscale/ray:2.9.3")
	RayLLMImage            = NewSetting(DefaultRayLLMImage, "anyscale/ray-llm:0.5.0")
	NotebookDefaultImages  = NewSetting(DefaultNotebookImagesSettingName, setDefaultNotebookImages())
)

Functions

func GetEnvKey

func GetEnvKey(key string) string

func IsRelease

func IsRelease() bool

func SetProvider

func SetProvider(p Provider) error

Types

type Image

type Image struct {
	ContainerImage string `json:"containerImage,omitempty"`
	Description    string `json:"description,omitempty"`
	Default        bool   `json:"default,omitempty"`
}

type Provider

type Provider interface {
	Get(name string) string
	Set(name, value string) error
	SetIfUnset(name, value string) error
	SetAll(settings map[string]Setting) error
}

type Setting

type Setting struct {
	Name     string
	Default  string
	ReadOnly bool
}

func NewSetting

func NewSetting(name, def string) Setting

func (Setting) Get

func (s Setting) Get() string

func (Setting) GetInt

func (s Setting) GetInt() int

func (Setting) Set

func (s Setting) Set(value string) error

func (Setting) SetIfUnset

func (s Setting) SetIfUnset(value string) error

Jump to

Keyboard shortcuts

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