Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeAppID(typ, name string) string
- func ComputeDependencyID(name string) string
- func DetectAppType(n ast.Node) (string, error)
- func KnownType(typ string) string
- func ParseURL(u string, normalize bool) (*url.URL, error)
- type App
- type AppDeployInfo
- type AppNeed
- type AppRunInfo
- type BasicApp
- func (a *BasicApp) Check(cfg *Project) error
- func (a *BasicApp) DeployInfo() *AppDeployInfo
- func (a *BasicApp) DeployPlugin() *plugins.Plugin
- func (a *BasicApp) Dir() string
- func (a *BasicApp) Env() map[string]string
- func (a *BasicApp) ID() string
- func (a *BasicApp) Name() string
- func (a *BasicApp) Normalize(cfg *Project) error
- func (a *BasicApp) PathRedirect() string
- func (a *BasicApp) Proto() *apiv1.App
- func (a *BasicApp) RunInfo() *AppRunInfo
- func (a *BasicApp) RunPlugin() *plugins.Plugin
- func (a *BasicApp) SupportsLocal() bool
- func (a *BasicApp) Type() string
- func (a *BasicApp) URL() *url.URL
- func (a *BasicApp) Validate() error
- func (a *BasicApp) YAMLError(path, msg string) error
- type DNS
- type Defaults
- type DefaultsDNS
- type DefaultsDeploy
- type DefaultsRun
- type Dependency
- func (d *Dependency) Check(key string, cfg *Project) error
- func (d *Dependency) DeployPlugin() *plugins.Plugin
- func (d *Dependency) ID() string
- func (d *Dependency) Normalize(key string, cfg *Project) error
- func (d *Dependency) Proto() *apiv1.Dependency
- func (d *Dependency) RunPlugin() *plugins.Plugin
- func (d *Dependency) SupportsLocal() bool
- func (d *Dependency) Validate() error
- func (d *Dependency) YAMLError(subPath, err string) error
- type DependencyDeploy
- type DependencyRun
- type FunctionApp
- type FunctionAppPackage
- type LoadMode
- type Monitoring
- type MonitoringChannel
- type MonitoringTarget
- type Plugin
- type Project
- func (p *Project) AppByID(n string) App
- func (p *Project) DependencyByID(n string) *Dependency
- func (p *Project) DependencyByName(n string) *Dependency
- func (p *Project) DomainInfoProto() []*apiv1.DomainInfo
- func (p *Project) Env() string
- func (p *Project) FindLoadedPlugin(name string) *plugins.Plugin
- func (p *Project) FullCheck() error
- func (p *Project) ID() string
- func (p *Project) LoadAppFile(file string, essentialKeys map[string]bool) error
- func (p *Project) LoadAppFiles(files []string, mode LoadMode) error
- func (p *Project) LoadApps(mode LoadMode) error
- func (p *Project) LoadPlugins(ctx context.Context, log logger.Logger, loader *plugins.Loader, ...) error
- func (p *Project) LoadedPlugins() []*plugins.Plugin
- func (p *Project) Lockfile() *lockfile.Lockfile
- func (p *Project) Normalize() error
- func (p *Project) PluginLock(plug *Plugin) *lockfile.Plugin
- func (p *Project) RegisterApp(app App) bool
- func (p *Project) SetLoadedPlugins(plugs []*plugins.Plugin)
- func (p *Project) Validate() error
- func (p *Project) YAMLData() []byte
- func (p *Project) YAMLNode() *ast.MappingNode
- func (p *Project) YAMLPath() string
- type ProjectOptions
- type SSLInfo
- type Secrets
- type ServiceApp
- type State
- func (s *State) Check(cfg *Project) error
- func (s *State) Env() string
- func (s *State) IsLocal() bool
- func (s *State) LoadLocal() (*statefile.StateData, error)
- func (s *State) LocalPath() string
- func (s *State) Normalize(cfg *Project) error
- func (s *State) Plugin() *plugins.Plugin
- func (s *State) SaveLocal(d *statefile.StateData) error
- type StaticApp
Constants ¶
View Source
const ( AppTypeStatic = "static" StaticAppRoutingReact = "react" StaticAppRoutingGatsby = "gatsby" StaticAppRoutingDisabled = "disabled" DefaultStaticAppBuildDir = "build" DefaultStaticAppBasicAuthRealm = "restricted" )
View Source
const ( ProjectYAMLName = "project.outblocks" LockfileName = "outblocks.lock" AppYAMLName = "app.outblocks" AppYAMLNameSuffix = ".app.outblocks" )
View Source
const ( StateLocal = "local" StateLocalPath = ".outblocks.state" )
View Source
const (
AppTypeFunction = "function"
)
View Source
const (
AppTypeService = "service"
)
Variables ¶
View Source
var ( ValidURLRegex = regexp.MustCompile(`^(https?://)?([a-zA-Z0-9-]+)((\.)([a-zA-Z0-9-]+)){1,}(/[a-zA-Z0-9-_]+)*(/)?$`) ValidNameRegex = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]{0,30}$`) ValidAppTypes = []string{AppTypeStatic, AppTypeFunction, AppTypeService} RunPluginDirect = "direct" )
View Source
var ( AppYAMLNames = []string{AppYAMLName, "outblocks"} DefaultKnownTypes = map[string][]string{ AppTypeFunction: {"functions"}, AppTypeStatic: {"statics"}, AppTypeService: {"services"}, } )
View Source
var (
ErrProjectConfigNotFound = errors.New("cannot find project config file, did you forget to initialize? run:\nok init")
)
View Source
var (
StaticAppRoutings = []string{StaticAppRoutingReact, StaticAppRoutingGatsby, StaticAppRoutingDisabled}
)
Functions ¶
func ComputeAppID ¶ added in v0.1.29
func ComputeDependencyID ¶ added in v0.1.35
Types ¶
type App ¶
type App interface {
ID() string
Name() string
Dir() string
URL() *url.URL
Env() map[string]string
PathRedirect() string
Normalize(cfg *Project) error
Check(cfg *Project) error
Type() string
Proto() *apiv1.App
BuildProto() *apiv1.AppBuild
RunInfo() *AppRunInfo
DeployInfo() *AppDeployInfo
SupportsLocal() bool
YAMLError(path, msg string) error
DeployPlugin() *plugins.Plugin
RunPlugin() *plugins.Plugin
}
func LoadFunctionAppData ¶
type AppDeployInfo ¶ added in v0.1.47
type AppDeployInfo struct {
Plugin string `json:"plugin,omitempty"`
Env map[string]string `json:"env,omitempty"`
Other map[string]interface{} `yaml:",remain"`
}
func (*AppDeployInfo) Proto ¶ added in v0.1.47
func (i *AppDeployInfo) Proto() *apiv1.AppDeployInfo
type AppNeed ¶
type AppNeed struct {
Dep string `yaml:"dependency,omitempty"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func (*AppNeed) Dependency ¶
func (n *AppNeed) Dependency() *Dependency
type AppRunInfo ¶ added in v0.1.47
type BasicApp ¶
type BasicApp struct {
AppName string `json:"name"`
AppType string `json:"type"`
AppURL string `json:"url"`
AppPathRedirect string `json:"path_redirect"`
AppEnv map[string]string `json:"env"`
AppDir string `json:"dir"`
AppRun *AppRunInfo `json:"run"`
AppDeploy *AppDeployInfo `json:"deploy"`
Needs map[string]*AppNeed `json:"needs"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func NewBasicApp ¶ added in v0.1.46
func NewBasicApp() *BasicApp
func (*BasicApp) DeployInfo ¶ added in v0.1.12
func (a *BasicApp) DeployInfo() *AppDeployInfo
func (*BasicApp) DeployPlugin ¶
func (*BasicApp) PathRedirect ¶ added in v0.1.12
func (*BasicApp) RunInfo ¶ added in v0.1.12
func (a *BasicApp) RunInfo() *AppRunInfo
func (*BasicApp) SupportsLocal ¶ added in v0.1.12
type DNS ¶
type DNS struct {
Domain string `json:"domain,omitempty"`
Domains []string `json:"domains,omitempty"`
Plugin string `json:"plugin,omitempty"`
SSLInfo *SSLInfo `json:"ssl,omitempty"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func (*DNS) Proto ¶ added in v0.1.107
func (s *DNS) Proto() *apiv1.DomainInfo
type Defaults ¶ added in v0.1.23
type Defaults struct {
Run DefaultsRun `json:"run,omitempty"`
Deploy DefaultsDeploy `json:"deploy,omitempty"`
DNS DefaultsDNS `json:"dns,omitempty"`
}
type DefaultsDNS ¶ added in v0.1.49
type DefaultsDeploy ¶ added in v0.1.23
type DefaultsRun ¶ added in v0.1.23
type Dependency ¶
type Dependency struct {
Name string `json:"-"`
Type string `json:"type"`
Deploy *DependencyDeploy `json:"deploy,omitempty"`
Run *DependencyRun `json:"run,omitempty"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func (*Dependency) DeployPlugin ¶
func (d *Dependency) DeployPlugin() *plugins.Plugin
func (*Dependency) ID ¶
func (d *Dependency) ID() string
func (*Dependency) Proto ¶ added in v0.1.47
func (d *Dependency) Proto() *apiv1.Dependency
func (*Dependency) RunPlugin ¶
func (d *Dependency) RunPlugin() *plugins.Plugin
func (*Dependency) SupportsLocal ¶ added in v0.1.12
func (d *Dependency) SupportsLocal() bool
func (*Dependency) Validate ¶
func (d *Dependency) Validate() error
func (*Dependency) YAMLError ¶ added in v0.1.51
func (d *Dependency) YAMLError(subPath, err string) error
type DependencyDeploy ¶ added in v0.1.12
type DependencyRun ¶ added in v0.1.12
type FunctionApp ¶
type FunctionApp struct {
BasicApp `json:",inline"`
types.FunctionAppProperties `json:",inline"`
Package *FunctionAppPackage `json:"package"`
AppBuild *apiv1.AppBuild `json:"-"`
}
func (*FunctionApp) BuildProto ¶ added in v0.1.60
func (s *FunctionApp) BuildProto() *apiv1.AppBuild
func (*FunctionApp) Proto ¶ added in v0.1.117
func (s *FunctionApp) Proto() *apiv1.App
func (*FunctionApp) SupportsLocal ¶ added in v0.1.12
func (s *FunctionApp) SupportsLocal() bool
type FunctionAppPackage ¶ added in v0.1.117
type FunctionAppPackage struct {
Patterns []string `json:"patterns"`
}
type Monitoring ¶ added in v0.1.123
type Monitoring struct {
PluginWanted string `json:"plugin,omitempty"`
Channels []*MonitoringChannel `json:"channels,omitempty"`
Targets []*MonitoringTarget `json:"targets,omitempty"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func (*Monitoring) Check ¶ added in v0.1.123
func (m *Monitoring) Check(cfg *Project) error
func (*Monitoring) Normalize ¶ added in v0.1.123
func (m *Monitoring) Normalize(cfg *Project) error
func (*Monitoring) Plugin ¶ added in v0.1.123
func (m *Monitoring) Plugin() *plugins.Plugin
func (*Monitoring) Proto ¶ added in v0.1.123
func (m *Monitoring) Proto() *apiv1.MonitoringData
func (*Monitoring) Validate ¶ added in v0.1.123
func (m *Monitoring) Validate() error
type MonitoringChannel ¶ added in v0.1.123
type MonitoringChannel struct {
Type string `json:"type"`
Other map[string]interface{} `yaml:"-,remain"`
}
func (*MonitoringChannel) Proto ¶ added in v0.1.123
func (c *MonitoringChannel) Proto() *apiv1.MonitoringChannel
func (*MonitoringChannel) Validate ¶ added in v0.1.123
func (c *MonitoringChannel) Validate() error
type MonitoringTarget ¶ added in v0.1.123
type MonitoringTarget struct {
TargetURL string `json:"url"`
Frequency int `json:"frequency,omitempty"`
Locations []string `json:"locations,omitempty"`
// contains filtered or unexported fields
}
func (*MonitoringTarget) Proto ¶ added in v0.1.123
func (t *MonitoringTarget) Proto() *apiv1.MonitoringTarget
func (*MonitoringTarget) URL ¶ added in v0.1.123
func (t *MonitoringTarget) URL() *url.URL
func (*MonitoringTarget) Validate ¶ added in v0.1.123
func (t *MonitoringTarget) Validate() error
type Plugin ¶
type Plugin struct {
Name string `json:"name"`
Version string `json:"version"`
Source string `json:"source,omitempty"`
Other map[string]interface{} `yaml:"-,remain"`
// contains filtered or unexported fields
}
func (*Plugin) VerConstr ¶ added in v0.1.5
func (p *Plugin) VerConstr() *semver.Constraints
type Project ¶
type Project struct {
Name string `json:"name,omitempty"`
Dir string `json:"-"`
State *State `json:"state,omitempty"`
Secrets *Secrets `json:"secrets,omitempty"`
Apps []App `json:"-"`
Dependencies map[string]*Dependency `json:"dependencies,omitempty"`
Plugins []*Plugin `json:"plugins,omitempty"`
DNS []*DNS `json:"dns,omitempty"`
Monitoring *Monitoring `json:"monitoring,omitempty"`
Defaults *Defaults `json:"defaults,omitempty"`
// contains filtered or unexported fields
}
func LoadProjectConfig ¶
func LoadProjectConfigData ¶
func (*Project) DependencyByID ¶ added in v0.1.35
func (p *Project) DependencyByID(n string) *Dependency
func (*Project) DependencyByName ¶ added in v0.1.35
func (p *Project) DependencyByName(n string) *Dependency
func (*Project) DomainInfoProto ¶ added in v0.1.49
func (p *Project) DomainInfoProto() []*apiv1.DomainInfo
func (*Project) FullCheck ¶
Logic validation after everything is loaded, e.g. check for supported types.
func (*Project) LoadAppFile ¶ added in v0.1.80
func (*Project) LoadAppFiles ¶ added in v0.1.80
func (*Project) LoadPlugins ¶ added in v0.1.5
func (*Project) LoadedPlugins ¶
func (*Project) RegisterApp ¶
func (*Project) SetLoadedPlugins ¶ added in v0.1.2
func (*Project) YAMLNode ¶ added in v0.1.111
func (p *Project) YAMLNode() *ast.MappingNode
type ProjectOptions ¶ added in v0.1.5
type ProjectOptions struct {
Env string
}
type Secrets ¶ added in v0.1.109
type ServiceApp ¶
type ServiceApp struct {
BasicApp `json:",inline"`
types.ServiceAppProperties `json:",inline"`
AppBuild *apiv1.AppBuild `json:"-"`
}
func (*ServiceApp) BuildProto ¶ added in v0.1.60
func (s *ServiceApp) BuildProto() *apiv1.AppBuild
func (*ServiceApp) Proto ¶ added in v0.1.47
func (s *ServiceApp) Proto() *apiv1.App
func (*ServiceApp) SupportsLocal ¶ added in v0.1.12
func (s *ServiceApp) SupportsLocal() bool
type State ¶
type StaticApp ¶
type StaticApp struct {
BasicApp `json:",inline"`
types.StaticAppProperties `json:",inline"`
}
func LoadStaticAppData ¶
func (*StaticApp) BuildProto ¶ added in v0.1.60
func (*StaticApp) SupportsLocal ¶ added in v0.1.12
Click to show internal directories.
Click to hide internal directories.