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 Mapper[A any, T any](of ...func(A) (A, error)) func(A) (T, error)
- func Skip(names ...string) func(source Source) (result Source, err error)
- type Api
- type App
- type AppExec
- type AppHtml
- type AppJs
- type Apphost
- type ApphostApi
- type ApphostCache
- type ApphostConn
- type ApphostEvent
- type ApphostEventType
- type ApphostListener
- type Bundle
- type BundleExec
- type BundleHtml
- type BundleJs
- type Cache
- type CreateProject
- type Dispatch
- type Dist
- type DistExec
- type DistHtml
- type DistJs
- type Env
- type Event
- type Exec
- type Find
- type Finder
- type Html
- type Js
- type Manifest
- type Msg
- type MsgSend
- type MsgSender
- type NewApi
- type NewApphost
- type NewTray
- type NodeInfo
- type NodeModule
- type PackageJson
- type Path
- type Port
- type Portal
- type PortalHtml
- type PortalJs
- type Portals
- type Project
- type ProjectGo
- type ProjectHtml
- type ProjectJs
- type ProjectNpm
- type Resolve
- type ResolveSource
- type Run
- type Runner
- type Serve
- 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
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 CreateProject ¶
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 PortalHtml ¶
type ProjectHtml ¶
type ProjectHtml interface {
ProjectNpm
Html
DistHtml() DistHtml
}
type ProjectJs ¶
type ProjectJs interface {
ProjectNpm
Js
DistJs() DistJs
}
type ProjectNpm ¶
type ProjectNpm interface {
Project
NodeModule
}
type ResolveSource ¶
type Template ¶
type Template interface {
Source
Info() TemplateInfo
Name() string
}
type TemplateInfo ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.