config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigName = "default"

Variables

This section is empty.

Functions

func AllValidContentTypeNames

func AllValidContentTypeNames() []string

func GetConfigDir

func GetConfigDir(base util.AbsolutePath) util.AbsolutePath

func GetConfigPath

func GetConfigPath(base util.AbsolutePath, configName string) util.AbsolutePath

func ListConfigFiles

func ListConfigFiles(base util.AbsolutePath) ([]util.AbsolutePath, error)

func ValidateFile

func ValidateFile(path util.AbsolutePath) error

Types

type Access

type Access struct {
	Type   AccessType `toml:"type" json:"type"`
	Users  []User     `toml:"users,omitempty" json:"users,omitempty"`
	Groups []Group    `toml:"groups,omitempty" json:"groups,omitempty"`
}

type AccessType

type AccessType string
const (
	AccessTypeAnonymous AccessType = "all"
	AccessTypeLoggedIn  AccessType = "logged-in"
	AccessTypeACL       AccessType = "acl"
)

type Config

type Config struct {
	Comments      []string    `toml:"-" json:"comments"`
	Schema        string      `toml:"$schema" json:"$schema"`
	Type          ContentType `toml:"type" json:"type"`
	Entrypoint    string      `toml:"entrypoint" json:"entrypoint,omitempty"`
	Validate      bool        `toml:"validate" json:"validate"`
	HasParameters bool        `toml:"has_parameters,omitempty" json:"hasParameters"`
	Files         []string    `toml:"files,multiline" json:"files"`
	Title         string      `toml:"title,omitempty" json:"title,omitempty"`
	Description   string      `toml:"description,multiline,omitempty" json:"description,omitempty"`
	ThumbnailFile string      `toml:"thumbnail,omitempty" json:"thumbnail,omitempty"`
	Tags          []string    `toml:"tags,omitempty" json:"tags,omitempty"`
	Python        *Python     `toml:"python,omitempty" json:"python,omitempty"`
	R             *R          `toml:"r,omitempty" json:"r,omitempty"`
	Jupyter       *Jupyter    `toml:"jupyter,omitempty" json:"jupyter,omitempty"`
	Quarto        *Quarto     `toml:"quarto,omitempty" json:"quarto,omitempty"`
	Environment   Environment `toml:"environment,omitempty" json:"environment,omitempty"`
	Secrets       []string    `toml:"secrets,omitempty" json:"secrets,omitempty"`
	Schedules     []Schedule  `toml:"schedules,omitempty" json:"schedules,omitempty"`
	Access        *Access     `toml:"access,omitempty" json:"access,omitempty"`
	Connect       *Connect    `toml:"connect,omitempty" json:"connect,omitempty"`
}

func FromFile

func FromFile(path util.AbsolutePath) (*Config, error)

func New

func New() *Config

func (*Config) AddSecret added in v1.1.7

func (cfg *Config) AddSecret(secret string) error

func (*Config) FillDefaults added in v1.2.0

func (cfg *Config) FillDefaults()

func (*Config) HasSecret added in v1.1.7

func (c *Config) HasSecret(secret string) bool

func (*Config) RemoveSecret added in v1.1.7

func (cfg *Config) RemoveSecret(secret string) error

func (*Config) Write

func (cfg *Config) Write(w io.Writer) error

func (*Config) WriteFile

func (cfg *Config) WriteFile(path util.AbsolutePath) error

type Connect

type Connect struct {
	Access     *ConnectAccess     `toml:"access,omitempty" json:"access,omitempty"`
	Runtime    *ConnectRuntime    `toml:"runtime,omitempty" json:"runtime,omitempty"`
	Kubernetes *ConnectKubernetes `toml:"kubernetes,omitempty" json:"kubernetes,omitempty"`
}

type ConnectAccess

type ConnectAccess struct {
	RunAs            string `toml:"run_as,omitempty" json:"runAs,omitempty"`
	RunAsCurrentUser *bool  `toml:"run_as_current_user,omitempty" json:"runAsCurrentUser,omitempty"`
}

type ConnectKubernetes

type ConnectKubernetes struct {
	MemoryRequest                  *int64   `toml:"memory_request,omitempty" json:"memoryRequest,omitempty"`
	MemoryLimit                    *int64   `toml:"memory_limit,omitempty" json:"memoryLimit,omitempty"`
	CPURequest                     *float64 `toml:"cpu_request,omitempty" json:"cpuRequest,omitempty"`
	CPULimit                       *float64 `toml:"cpu_limit,omitempty" json:"cpuLimit,omitempty"`
	AMDGPULimit                    *int64   `toml:"amd_gpu_limit,omitempty" json:"amdGpuLimit,omitempty"`
	NvidiaGPULimit                 *int64   `toml:"nvidia_gpu_limit,omitempty" json:"nvidiaGpuLimit,omitempty"`
	ServiceAccountName             string   `toml:"service_account_name,omitempty" json:"serviceAccountName,omitempty"`
	DefaultImageName               string   `toml:"default_image_name,omitempty" json:"defaultImageName,omitempty"`
	DefaultREnvironmentManagement  *bool    `toml:"default_r_environment_management,omitempty" json:"defaultREnvironmentManagement"`
	DefaultPyEnvironmentManagement *bool    `toml:"default_py_environment_management,omitempty" json:"defaultPyEnvironmentManagement"`
}

type ConnectRuntime

type ConnectRuntime struct {
	ConnectionTimeout  *int32   `toml:"connection_timeout,omitempty" json:"connectionTimeout,omitempty"`
	ReadTimeout        *int32   `toml:"read_timeout,omitempty" json:"readTimeout,omitempty"`
	InitTimeout        *int32   `toml:"init_timeout,omitempty" json:"initTimeout,omitempty"`
	IdleTimeout        *int32   `toml:"idle_timeout,omitempty" json:"idleTimeout,omitempty"`
	MaxProcesses       *int32   `toml:"max_processes,omitempty" json:"maxProcesses,omitempty"`
	MinProcesses       *int32   `toml:"min_processes,omitempty" json:"minProcesses,omitempty"`
	MaxConnsPerProcess *int32   `toml:"max_conns_per_process,omitempty" json:"maxConnsPerProcess,omitempty"`
	LoadFactor         *float64 `toml:"load_factor,omitempty" json:"loadFactor,omitempty"`
}

type ContentType

type ContentType string
const (
	ContentTypeHTML             ContentType = "html"
	ContentTypeJupyterNotebook  ContentType = "jupyter-notebook"
	ContentTypeJupyterVoila     ContentType = "jupyter-voila"
	ContentTypePythonBokeh      ContentType = "python-bokeh"
	ContentTypePythonDash       ContentType = "python-dash"
	ContentTypePythonFastAPI    ContentType = "python-fastapi"
	ContentTypePythonFlask      ContentType = "python-flask"
	ContentTypePythonShiny      ContentType = "python-shiny"
	ContentTypePythonStreamlit  ContentType = "python-streamlit"
	ContentTypePythonGradio     ContentType = "python-gradio"
	ContentTypeQuartoShiny      ContentType = "quarto-shiny"
	ContentTypeQuartoDeprecated ContentType = "quarto"
	ContentTypeQuarto           ContentType = "quarto-static"
	ContentTypeRPlumber         ContentType = "r-plumber"
	ContentTypeRShiny           ContentType = "r-shiny"
	ContentTypeRMarkdownShiny   ContentType = "rmd-shiny"
	ContentTypeRMarkdown        ContentType = "rmd"
	ContentTypeUnknown          ContentType = "unknown"
)

func (ContentType) IsAPIContent

func (t ContentType) IsAPIContent() bool

func (ContentType) IsAppContent

func (t ContentType) IsAppContent() bool

func (ContentType) IsPythonContent

func (t ContentType) IsPythonContent() bool

type Environment

type Environment = map[string]string

type Group

type Group struct {
	Id          string `toml:"id,omitempty" json:"id,omitempty"`
	GUID        string `toml:"guid,omitempty" json:"guid,omitempty"`
	Name        string `toml:"name,omitempty" json:"name,omitempty"`
	Permissions string `toml:"permissions" json:"permissions"`
}

type Jupyter added in v1.4.0

type Jupyter struct {
	HideAllInput    bool `toml:"hide_all_input,omitempty" json:"hideAllInput"`
	HideTaggedInput bool `toml:"hide_tagged_input,omitempty" json:"hideTaggedInput"`
}

type Python

type Python struct {
	Version        string `toml:"version" json:"version"`
	PackageFile    string `toml:"package_file,omitempty" json:"packageFile"`
	PackageManager string `toml:"package_manager,omitempty" json:"packageManager"`
}

type Quarto

type Quarto struct {
	Version string   `toml:"version" json:"version"`
	Engines []string `toml:"engines" json:"engines"`
}

type R

type R struct {
	Version        string `toml:"version" json:"version"`
	PackageFile    string `toml:"package_file,omitempty" json:"packageFile"`
	PackageManager string `toml:"package_manager,omitempty" json:"packageManager"`
}

type Schedule

type Schedule struct {
	Start      string `toml:"start" json:"start"`
	Recurrence string `toml:"recurrence" json:"recurrence"`
}

type User

type User struct {
	Id          string `toml:"id,omitempty" json:"id,omitempty"`
	GUID        string `toml:"guid,omitempty" json:"guid,omitempty"`
	Name        string `toml:"name,omitempty" json:"name,omitempty"`
	Permissions string `toml:"permissions" json:"permissions"`
}

Jump to

Keyboard shortcuts

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