intent

package
v0.0.0-...-4b98c26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstanceWebapps

func GetInstanceWebapps(inst *instance.Instance) ([]string, error)

GetInstanceWebapps returns the list of available webapps for the instance by iterating over its registries

Types

type AvailableApp

type AvailableApp struct {
	Slug string `json:"slug"`
	Name string `json:"name"`
}

AvailableApp is a struct for the apps that are in the apps registry but not installed, and can be used for the intent.

type Intent

type Intent struct {
	IID           string         `json:"_id,omitempty"`
	IRev          string         `json:"_rev,omitempty"`
	Action        string         `json:"action"`
	Type          string         `json:"type"`
	Permissions   []string       `json:"permissions"`
	Client        string         `json:"client"`
	Services      []Service      `json:"services"`
	AvailableApps []AvailableApp `json:"availableApps"`
}

Intent is a struct for a call from a client-side app to have another app do something for it

func (*Intent) Clone

func (in *Intent) Clone() couchdb.Doc

Clone implements couchdb.Doc

func (*Intent) DocType

func (in *Intent) DocType() string

DocType is used to implement the couchdb.Doc interface

func (*Intent) FillAvailableWebapps

func (in *Intent) FillAvailableWebapps(inst *instance.Instance) error

FillAvailableWebapps finds webapps which can answer to the intent from non-installed instance webapps

func (*Intent) FillServices

func (in *Intent) FillServices(instance *instance.Instance) error

FillServices looks at all the application that can answer this intent and save them in the services field

func (*Intent) GenerateHref

func (in *Intent) GenerateHref(instance *instance.Instance, slug, target string) string

GenerateHref creates the href where the service can be called for an intent

func (*Intent) ID

func (in *Intent) ID() string

ID is used to implement the couchdb.Doc interface

func (*Intent) Rev

func (in *Intent) Rev() string

Rev is used to implement the couchdb.Doc interface

func (*Intent) Save

func (in *Intent) Save(instance *instance.Instance) error

Save will persist the intent in CouchDB

func (*Intent) SetID

func (in *Intent) SetID(id string)

SetID is used to implement the couchdb.Doc interface

func (*Intent) SetRev

func (in *Intent) SetRev(rev string)

SetRev is used to implement the couchdb.Doc interface

type Service

type Service struct {
	Slug string `json:"slug"`
	Href string `json:"href"`
}

Service is a struct for an app that can serve an intent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL