Documentation
¶
Index ¶
- Constants
- Variables
- func Abs(src string) string
- func ApiFactory(wrap func(Api) Api, frontendApphost NewApphost, backendApphost NewApphost) func(context.Context, Portal_) Api
- 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)
- type Api
- 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 Bundle
- type BundleExec
- type BundleHtml
- type BundleJs
- type Bundle_
- type Cache
- type Dispatch
- 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 NewApi
- type NewApphost
- 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 Resolve
- type Run
- type Runner
- type Source
- type Template
- type TemplateInfo
- type Tray
- 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 PackageJsonFilename = "package.json"
View Source
const PortalJsonFilename = "portal.json"
View Source
const TemplateInfoFileName = "template.json"
Variables ¶
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 ¶
func ApiFactory ¶
func ApiFactory( wrap func(Api) Api, frontendApphost NewApphost, backendApphost NewApphost, ) func(context.Context, Portal_) Api
ApiFactory deprecated FIXME refactor & remove
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 BundleExec ¶
type BundleHtml ¶
type Manifest ¶
type Manifest struct { Name string `json:"name,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Package string `json:"package,omitempty"` Version string `json:"version,omitempty"` Icon string `json:"icon,omitempty"` Exec string `json:"exec,omitempty"` Build string `json:"build,omitempty"` Env Env `json:"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 Portals ¶
type Portals[T Portal_] []T
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.