Documentation
¶
Index ¶
- Constants
- Variables
- func AddUserFile(ctx context.Context, file *types.UserFile) error
- func AppFileOptions() *syntax.FileOptions
- func ClearCleanup(thread *starlark.Thread, key string)
- func CreatePluginApi(f StarlarkFunction, opType PluginFunctionType) plugin.PluginFunc
- func CreatePluginApiName(...) plugin.PluginFunc
- func CreatePluginConstant(name string, value starlark.Value) plugin.PluginFunc
- func DeferCleanup(thread *starlark.Thread, key string, deferFunc apptype.DeferFunc, strict bool)
- func DeleteUserFile(ctx context.Context, id string) error
- func FetchPluginState(thread *starlark.Thread, key string) any
- func GetContext(thread *starlark.Thread) context.Context
- func GetUserFile(ctx context.Context, id string) (*types.UserFile, error)
- func InitFileStore(ctx context.Context, connectString string) error
- func NewFSPlugin(pluginContext *types.PluginContext) (any, error)
- func RegisterPlugin(name string, builder plugin.NewPluginFunc, funcs []plugin.PluginFunc)
- func SavePluginState(thread *starlark.Thread, key string, value any)
- type AccessType
- type App
- type AppPlugins
- type ContainerManager
- func (m *ContainerManager) Close() error
- func (m *ContainerManager) DevReload(dryRun bool) error
- func (m *ContainerManager) GetEnvMap() (map[string]string, string)
- func (m *ContainerManager) GetHealthUrl(appHealthUrl string) string
- func (m *ContainerManager) GetProxyUrl() string
- func (m *ContainerManager) ProdReload(dryRun bool) error
- func (m *ContainerManager) Run(ctx context.Context, path string, cmdArgs []string, env []string) (*exec.Cmd, error)
- func (m *ContainerManager) WaitForHealth(attempts int) error
- type ContainerState
- type FileInfo
- type PluginFunctionType
- type PluginResponse
- func (r *PluginResponse) Attr(name string) (starlark.Value, error)
- func (r *PluginResponse) AttrNames() []string
- func (r *PluginResponse) Freeze()
- func (r *PluginResponse) Hash() (uint32, error)
- func (r *PluginResponse) String() string
- func (r *PluginResponse) Truth() starlark.Bool
- func (r *PluginResponse) Type() string
- func (r *PluginResponse) UnmarshalStarlarkType() (any, error)
- type SSEMessage
- type StarlarkFunction
Constants ¶
View Source
const ( CONTAINERFILE = "Containerfile" DOCKERFILE = "Dockerfile" )
View Source
const ( DEFAULT_FILE_LIMIT = 10_000 MAX_FILE_LIMIT = 100_000 )
View Source
const UNNAMED_VOLUME = "<UNNAMED>"
View Source
const (
VOL_PREFIX_SECRET = "cl_secret:"
)
Variables ¶
View Source
var ( REAL_IP_HEADER = "X-Real-IP" FORWARDED_HEADER = "X-Forwarded-For" CONTENT_TYPE_JSON = []string{"application/json"} CONTENT_TYPE_TEXT = []string{"text/plain"} SERVER_NAME = []string{"OpenRun"} VARY_HEADER_VALUE = []string{"HX-Request"} )
Functions ¶
func AppFileOptions ¶ added in v0.15.2
func AppFileOptions() *syntax.FileOptions
func ClearCleanup ¶
ClearCleanup clears a defer function from the thread local
func CreatePluginApi ¶
func CreatePluginApi(f StarlarkFunction, opType PluginFunctionType) plugin.PluginFunc
func CreatePluginApiName ¶
func CreatePluginApiName( f func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error), opType PluginFunctionType, name string) plugin.PluginFunc
CreatePluginApiName creates a OpenRun plugin function
func CreatePluginConstant ¶
func CreatePluginConstant(name string, value starlark.Value) plugin.PluginFunc
func DeferCleanup ¶
DeferCleanup defers a close function to call when the API handler is done
func FetchPluginState ¶
FetchPluginState fetches a value from the thread local for the plugin
func NewFSPlugin ¶
func NewFSPlugin(pluginContext *types.PluginContext) (any, error)
func RegisterPlugin ¶
func RegisterPlugin(name string, builder plugin.NewPluginFunc, funcs []plugin.PluginFunc)
RegisterPlugin registers a plugin with OpenRun
Types ¶
type AccessType ¶
type AccessType string
const ( UserAccess AccessType = "user" AppAccess AccessType = "app" )
type App ¶
type App struct {
*types.Logger
*types.AppEntry
Name string
CustomLayout bool
// App config that takes default values from toml config, overridden with app level metadata.
// It is important that this property is used instead of reading from app metadata config, so that toml
// config defaults are applied.
AppConfig types.AppConfig
AppRunPath string // path to the app run directory
// contains filtered or unexported fields
}
App is the main object that represents a OpenRun app. It is created when the app is loaded
func NewApp ¶
func NewApp(sourceFS *appfs.SourceFs, workFS *appfs.WorkFs, logger *types.Logger, appEntry *types.AppEntry, systemConfig *types.SystemConfig, plugins map[string]types.PluginSettings, appConfig types.AppConfig, notifyClose chan<- types.AppPathDomain, secretEvalFunc func([][]string, string, string) (string, error), auditInsert func(*types.AuditEvent) error, serverConfig *types.ServerConfig, authorizer types.AuthorizerFunc) (*App, error)
type AppPlugins ¶
func NewAppPlugins ¶
func NewAppPlugins(app *App, pluginConfig map[string]types.PluginSettings, appAccounts []types.AccountLink) *AppPlugins
func (*AppPlugins) GetPlugin ¶
func (p *AppPlugins) GetPlugin(pluginInfo *plugin.PluginInfo, accountName string) (any, error)
type ContainerManager ¶
type ContainerManager struct {
*types.Logger
GenImageName container.ImageName // generated image name
// contains filtered or unexported fields
}
func NewContainerManager ¶
func NewContainerManager(logger *types.Logger, app *App, containerFile string, systemConfig *types.SystemConfig, configPort int64, lifetime, scheme, health, buildDir string, sourceFS appfs.ReadableFS, paramMap map[string]string, containerConfig types.Container, stripAppPath bool, containerVolumes []string, secretsAllowed [][]string, cargs map[string]any) (*ContainerManager, error)
func (*ContainerManager) Close ¶
func (m *ContainerManager) Close() error
func (*ContainerManager) DevReload ¶
func (m *ContainerManager) DevReload(dryRun bool) error
func (*ContainerManager) GetEnvMap ¶
func (m *ContainerManager) GetEnvMap() (map[string]string, string)
func (*ContainerManager) GetHealthUrl ¶
func (m *ContainerManager) GetHealthUrl(appHealthUrl string) string
func (*ContainerManager) GetProxyUrl ¶
func (m *ContainerManager) GetProxyUrl() string
func (*ContainerManager) ProdReload ¶
func (m *ContainerManager) ProdReload(dryRun bool) error
func (*ContainerManager) WaitForHealth ¶
func (m *ContainerManager) WaitForHealth(attempts int) error
type ContainerState ¶
type ContainerState string
const ( ContainerStateUnknown ContainerState = "unknown" ContainerStateRunning ContainerState = "running" ContainerStateIdleShutdown ContainerState = "idle_shutdown" ContainerStateHealthFailure ContainerState = "health_failure" )
type PluginFunctionType ¶
type PluginFunctionType int
const ( READ PluginFunctionType = iota WRITE READ_WRITE )
type PluginResponse ¶
type PluginResponse struct {
// contains filtered or unexported fields
}
PluginResponse is a starlark.Value that represents the response to a plugin request
func NewErrorCodeResponse ¶
func NewErrorCodeResponse(errorCode int, err error, value any) *PluginResponse
func NewErrorResponse ¶
func NewErrorResponse(err error, thread *starlark.Thread) *PluginResponse
func NewResponse ¶
func NewResponse(value any) *PluginResponse
func NewStreamResponse ¶
func NewStreamResponse(value any) *PluginResponse
func (*PluginResponse) AttrNames ¶
func (r *PluginResponse) AttrNames() []string
func (*PluginResponse) Freeze ¶
func (r *PluginResponse) Freeze()
func (*PluginResponse) Hash ¶
func (r *PluginResponse) Hash() (uint32, error)
func (*PluginResponse) String ¶
func (r *PluginResponse) String() string
func (*PluginResponse) Truth ¶
func (r *PluginResponse) Truth() starlark.Bool
func (*PluginResponse) Type ¶
func (r *PluginResponse) Type() string
func (*PluginResponse) UnmarshalStarlarkType ¶
func (r *PluginResponse) UnmarshalStarlarkType() (any, error)
type SSEMessage ¶
type SSEMessage struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.