service

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViewComponentTypeWeb  = "web"
	ViewComponentTypeFlex = "flex"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionComponent

type ActionComponent struct {
	Component
}

type Component

type Component struct {
	ID          core.ID       `json:"id"`
	Type        ComponentType `json:"type"`
	SubType     string        `json:"subType"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Author      core.ID       `json:"author"`
	Universe    core.ID       `json:"universe"`
	Public      bool          `json:"public"`
	Listed      bool          `json:"listed"`
	Profile     core.ID       `json:"profile"`
}

type ComponentType

type ComponentType string
const (
	ComponentTypeView    ComponentType = "view"
	ComponentTypeService ComponentType = "service"
	ComponentTypeAction  ComponentType = "action"
)

type CreateAppRequest

type CreateAppRequest struct {
	Name     string  `json:"name"`
	Universe core.ID `json:"universe"`
	Public   bool    `json:"public"`
}

type CreateComponentRequest

type CreateComponentRequest struct {
	Name     string        `json:"name"`
	Type     ComponentType `json:"type"`
	SubType  string        `json:"subType"`
	Universe core.ID       `json:"universe"`
}

type CreateEndpointServiceRequest

type CreateEndpointServiceRequest struct {
	Name       string              `json:"name"`
	Definition system.EndpointNode `json:"definition"`
}

type CreateInterfaceServiceRequest

type CreateInterfaceServiceRequest struct {
	Name       string                `json:"name"`
	Definition system.NamedInterface `json:"definition"`
}

type CreateModelServiceRequest

type CreateModelServiceRequest struct {
	Name        string  `json:"name"`
	Object      core.ID `json:"object"`
	Type        string  `json:"type"`
	Description string  `json:"description"`
}

type CreateRouteRequest

type CreateRouteRequest struct {
	Route string  `json:"route"`
	View  core.ID `json:"view"`
}

type FlexViewComponent

type FlexViewComponent struct {
	ViewComponent
	Definition string `json:"definition"` // TODO: Replace with actual form definition (TBD)
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	User  UserInfo `json:"user"`
	Token string   `json:"token"`
}

type ServiceClient

type ServiceClient struct {
	// contains filtered or unexported fields
}

func NewServiceClient

func NewServiceClient(endpoint string) *ServiceClient

func (*ServiceClient) CreateComponent

func (sc *ServiceClient) CreateComponent(name string, componentType ComponentType, subType string, universe core.ID) (Component, error)

func (*ServiceClient) CreateEndpoint

func (sc *ServiceClient) CreateEndpoint(universeID core.ID, definition system.EndpointNode) (system.EndpointNode, error)

func (*ServiceClient) CreateInterface

func (sc *ServiceClient) CreateInterface(universeID core.ID, definition system.NamedInterface) (system.NamedInterface, error)

func (*ServiceClient) CreateModel

func (sc *ServiceClient) CreateModel(universeID core.ID, name string, objectID core.ID, modelType string, description string) error

func (*ServiceClient) DeleteComponent

func (sc *ServiceClient) DeleteComponent(id core.ID) error

func (*ServiceClient) DeleteEndpoint

func (sc *ServiceClient) DeleteEndpoint(universeID core.ID, name string) error

func (*ServiceClient) DeleteInterface

func (sc *ServiceClient) DeleteInterface(universeID core.ID, name string) error

func (*ServiceClient) DeleteModel

func (sc *ServiceClient) DeleteModel(universeID core.ID, name string) error

func (*ServiceClient) GetComponent

func (sc *ServiceClient) GetComponent(componentID core.ID) (Component, error)

func (*ServiceClient) GetComponents

func (sc *ServiceClient) GetComponents(universe core.ID, componentType ComponentType, subType string) ([]Component, error)

func (*ServiceClient) GetEndpointInterfaces

func (sc *ServiceClient) GetEndpointInterfaces(universeID core.ID, endpointName string) ([]system.Interface, error)

func (*ServiceClient) GetFlexView

func (sc *ServiceClient) GetFlexView(componentID core.ID) (FlexViewComponent, error)

func (*ServiceClient) GetLayerProfile

func (sc *ServiceClient) GetLayerProfile(profileID core.ID) (system.LayerProfile, error)

func (*ServiceClient) GetUniverseCode

func (sc *ServiceClient) GetUniverseCode(universeName string, language string) (string, error)

func (*ServiceClient) GetUniverseJSONSchema

func (sc *ServiceClient) GetUniverseJSONSchema(universeName string) (string, error)

func (*ServiceClient) GetWebView

func (sc *ServiceClient) GetWebView(componentID core.ID) (WebViewComponent, error)

func (*ServiceClient) Info

func (sc *ServiceClient) Info() (ServiceInfo, error)

func (*ServiceClient) LoadUniverse

func (sc *ServiceClient) LoadUniverse(id core.ID) (system.Universe, error)

func (*ServiceClient) ResolveUniverse

func (sc *ServiceClient) ResolveUniverse(name string) (core.ID, error)

func (*ServiceClient) SetToken

func (sc *ServiceClient) SetToken(token string)

func (*ServiceClient) UpdateComponent

func (sc *ServiceClient) UpdateComponent(id core.ID, name *string, description *string, public *bool, listed *bool) (Component, error)

func (*ServiceClient) UpdateEndpoint

func (sc *ServiceClient) UpdateEndpoint(universeID core.ID, definition system.EndpointNode) (system.EndpointNode, error)

func (*ServiceClient) UpdateFlexView

func (sc *ServiceClient) UpdateFlexView(componentID core.ID, definition *string) (FlexViewComponent, error)

func (*ServiceClient) UpdateModel

func (sc *ServiceClient) UpdateModel(universeID core.ID, name string, description *string) error

func (*ServiceClient) UpdateUniverse

func (sc *ServiceClient) UpdateUniverse(universeID core.ID, description *string, public *bool, extensible *bool) error

func (*ServiceClient) UpdateWebView

func (sc *ServiceClient) UpdateWebView(componentID core.ID, tag *string) (WebViewComponent, error)

type ServiceComponent

type ServiceComponent struct {
	Component
}

type ServiceInfo

type ServiceInfo struct {
	// APIVersion represents the API version
	APIVersion string `json:"apiVersion"`

	// ServerVersion represents the version of the server
	ServerVersion string `json:"serverVersion"`

	// UnixTime contains the server time
	UnixTime int64 `json:"unixTime"`

	// UserID contains the user core.ID of the provided token
	UserID core.ID `json:"user"`

	// Permissions contains the permissions of the provided token
	Permissions []string `json:"permissions"`
}

type UpdateAppRequest

type UpdateAppRequest struct {
	Name        *string `json:"name,omitempty"`
	Public      *bool   `json:"public,omitempty"`
	Description *string `json:"description,omitempty"`
	Path        *string `json:"path,omitempty"`
	Title       *string `json:"title,omitempty"`
}

type UpdateComponentRequest

type UpdateComponentRequest struct {
	Name        *string  `json:"name,omitempty"`
	Description *string  `json:"description,omitempty"`
	Public      *bool    `json:"public,omitempty"`
	Listed      *bool    `json:"listed,omitempty"`
	Profile     *core.ID `json:"profile,omitempty"`
	Title       *string  `json:"title,omitempty"`
}

type UpdateEndpointServiceRequest

type UpdateEndpointServiceRequest struct {
	Name       string              `json:"name"`
	Definition system.EndpointNode `json:"definition"`
}

type UpdateFlexViewRequest

type UpdateFlexViewRequest struct {
	Definition *string `json:"definition"`
}

type UpdateModelServiceRequest

type UpdateModelServiceRequest struct {
	Description *string `json:"description"`
}

type UpdateUniverseServiceRequest

type UpdateUniverseServiceRequest struct {
	Description *string `json:"description,omitempty"`
	Public      *bool   `json:"public,omitempty"`
	Extensible  *bool   `json:"extensible,omitempty"`
}

type UpdateViewRequest

type UpdateViewRequest struct {
	Model *string `json:"model,omitempty"`
	List  *bool   `json:"list,omitempty"`
}

type UpdateWebViewRequest

type UpdateWebViewRequest struct {
	Tag *string `json:"tag,omitempty"`
}

type UserInfo

type UserInfo struct {
	ID   core.ID `json:"id"`
	Name string  `json:"name"`
}

type ViewComponent

type ViewComponent struct {
	Component
	Model string `json:"model"`
	List  bool   `json:"list"`
}

type WebViewComponent

type WebViewComponent struct {
	ViewComponent
	Tag string `json:"tag"`
}

Jump to

Keyboard shortcuts

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