Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(src string) string
- func CacheDir(name string) (dir string)
- func Combine[A any, T any](of ...func(A) (A, error)) func(A) (T, error)
- func List[T any](resolve Resolve[T], from ...Source) (out []T)
- func Match[T any](arg Portal_) (ok bool)
- func Skip(names ...string) func(source Source) (result Source, err error)
- func Sprint(source Portal_) string
- type App
- type AppBundle
- type AppExec
- type AppHtml
- type AppJs
- type App_
- type Apphost
- type ApphostApi
- type ApphostCache
- type ApphostConn
- type ApphostEvent
- type ApphostEventType
- type ApphostListener
- type Build
- type Builds
- type Bundle
- type BundleExec
- type BundleHtml
- type BundleJs
- type Bundle_
- type Cache
- type Dist
- type DistExec
- type DistHtml
- type DistJs
- type Dist_
- type Env
- type Event
- type Exec
- type File
- type Find
- type Html
- type Js
- type Manifest
- type Matcher
- type Msg
- type MsgSend
- type MsgSender
- type NewApphost
- type NewRuntime
- type NodeInfo
- type NodeModule
- type PackageJson
- type Path
- type Port
- type Portal
- type PortalExec
- type PortalHtml
- type PortalJs
- type Portal_
- type Portals
- type Priority
- type Project
- type ProjectExec
- type ProjectGo
- type ProjectHtml
- type ProjectJs
- type ProjectNpm
- type ProjectNpm_
- type Project_
- type Request
- type Resolve
- type Run
- type Runner
- type Runtime
- type Source
- type Template
- type TemplateInfo
- type Type
Constants ¶
View Source
const ( Log = "_log" Sleep = "_sleep" ServiceRegister = "_astral_service_register" ServiceClose = "_astral_service_close" ConnAccept = "_astral_conn_accept" ConnClose = "_astral_conn_close" ConnWrite = "_astral_conn_write" ConnRead = "_astral_conn_read" Query = "_astral_query" QueryName = "_astral_query_name" GetNodeInfo = "_astral_node_info" ResolveId = "_astral_resolve" Interrupt = "_astral_interrupt" )
View Source
const BuildFilename = "dev.portal"
View Source
const ManifestFilename = "portal"
View Source
const PackageJsonFilename = "package"
View Source
const TemplateInfoFileName = "template.json"
Variables ¶
View Source
var ErrNotFound = errors.New("no targets found")
View Source
var ErrNotTarget = errors.New("not a target")
View Source
var PortMsg = PortPortal.Route("broadcast")
View Source
var PortOpen = PortPortal.Route("open")
View Source
var PortPortal = NewPort("portal")
Functions ¶
Types ¶
type Apphost ¶
type Apphost interface { ApphostCache ApphostApi }
type ApphostApi ¶
type ApphostApi interface { Close() error Interrupt() Log(arg ...any) LogArr(arg []any) Sleep(duration int64) ServiceRegister(service string) (err error) ServiceClose(service string) (err error) ConnAccept(service string) (data string, err error) ConnClose(id string) (err error) ConnWrite(id string, data string) (err error) ConnRead(id string) (data string, err error) Query(identity string, query string) (data string, err error) QueryName(name string, query string) (data string, err error) Resolve(name string) (id string, err error) NodeInfo(identity string) (info NodeInfo, err error) }
type ApphostCache ¶
type ApphostCache interface { Connections() []ApphostConn Listeners() []ApphostListener Events() *sig.Queue[ApphostEvent] }
type ApphostConn ¶
type ApphostEvent ¶
type ApphostEvent struct { Type ApphostEventType Port string Ref string }
type ApphostEventType ¶
type ApphostEventType int
const ( ApphostConnect ApphostEventType = iota ApphostDisconnect ApphostRegister ApphostUnregister )
type ApphostListener ¶
type ApphostListener struct {
Port string
}
type Builds ¶ added in v0.1.1
func LoadBuilds ¶ added in v0.1.1
type BundleExec ¶
type BundleHtml ¶
type Manifest ¶
type Manifest struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Title string `json:"title,omitempty" yaml:"title,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Package string `json:"package,omitempty" yaml:"package,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` Exec string `json:"exec,omitempty" yaml:"exec,omitempty"` Env Env `json:"env,omitempty" yaml:"env,omitempty"` }
type NodeModule ¶
type NodeModule interface { Source PkgJson() *PackageJson }
type PackageJson ¶
type PackageJson struct { Portal string `json:"portal,omitempty"` Scripts struct { Build string `json:"build"` } `json:"scripts,omitempty"` }
func (PackageJson) CanBuild ¶
func (p PackageJson) CanBuild() bool
func (PackageJson) IsPortalLib ¶
func (p PackageJson) IsPortalLib() bool
type PortalExec ¶ added in v0.1.0
type PortalHtml ¶
type ProjectExec ¶ added in v0.1.0
type ProjectHtml ¶
type ProjectHtml ProjectNpm[Html]
type ProjectJs ¶
type ProjectJs ProjectNpm[Js]
type ProjectNpm ¶
type ProjectNpm[T any] interface { Project[T] PkgJson() *PackageJson }
type ProjectNpm_ ¶ added in v0.1.0
type ProjectNpm_ interface { Project_ PkgJson() *PackageJson }
type Template ¶
type Template interface { Source Info() TemplateInfo Name() string }
type TemplateInfo ¶
Click to show internal directories.
Click to hide internal directories.