scene

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterIDFrom = id.ClusterIDFrom
View Source
var ClusterIDFromRef = id.ClusterIDFromRef
View Source
var (
	ErrDuplicatedWidgetInstance = errors.New("duplicated widget instance")
)
View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var ErrSceneIsLocked error = errors.New("scene is locked")
View Source
var IDFrom = id.SceneIDFrom
View Source
var IDFromRef = id.SceneIDFromRef
View Source
var LayerIDFrom = id.LayerIDFrom
View Source
var LayerIDFromRef = id.LayerIDFromRef
View Source
var MustClusterID = id.MustClusterID
View Source
var MustID = id.MustSceneID
View Source
var MustLayerID = id.MustLayerID
View Source
var MustPluginID = id.MustPluginID
View Source
var MustProjectID = id.MustProjectID
View Source
var MustPropertyID = id.MustPropertyID
View Source
var MustTeamID = id.MustTeamID
View Source
var MustWidgetID = id.MustWidgetID
View Source
var NewClusterID = id.NewClusterID
View Source
var NewID = id.NewSceneID
View Source
var NewLayerID = id.NewLayerID
View Source
var NewPluginID = id.NewPluginID
View Source
var NewProjectID = id.NewProjectID
View Source
var NewPropertyID = id.NewPropertyID
View Source
var NewTeamID = id.NewTeamID
View Source
var NewWidgetID = id.NewWidgetID
View Source
var OfficialPluginID = id.OfficialPluginID
View Source
var PluginIDFrom = id.PluginIDFrom
View Source
var PluginIDFromRef = id.PluginIDFromRef
View Source
var ProjectIDFrom = id.ProjectIDFrom
View Source
var ProjectIDFromRef = id.ProjectIDFromRef
View Source
var PropertyIDFrom = id.PropertyIDFrom
View Source
var PropertyIDFromRef = id.PropertyIDFromRef
View Source
var TeamIDFrom = id.TeamIDFrom
View Source
var TeamIDFromRef = id.TeamIDFromRef
View Source
var WidgetIDFrom = id.WidgetIDFrom
View Source
var WidgetIDFromRef = id.WidgetIDFromRef

Functions

This section is empty.

Types

type Builder

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

func New

func New() *Builder

func (*Builder) Build

func (b *Builder) Build() (*Scene, error)

func (*Builder) Clusters added in v0.3.0

func (b *Builder) Clusters(cl *ClusterList) *Builder

func (*Builder) ID

func (b *Builder) ID(id ID) *Builder

func (*Builder) MustBuild

func (b *Builder) MustBuild() *Scene

func (*Builder) NewID

func (b *Builder) NewID() *Builder

func (*Builder) Plugins added in v0.4.0

func (b *Builder) Plugins(plugins *Plugins) *Builder

func (*Builder) Project

func (b *Builder) Project(prj ProjectID) *Builder

func (*Builder) Property

func (b *Builder) Property(p PropertyID) *Builder

func (*Builder) RootLayer

func (b *Builder) RootLayer(rootLayer LayerID) *Builder

func (*Builder) Team

func (b *Builder) Team(team TeamID) *Builder

func (*Builder) UpdatedAt

func (b *Builder) UpdatedAt(updatedAt time.Time) *Builder

func (*Builder) Widgets added in v0.4.0

func (b *Builder) Widgets(widgets *Widgets) *Builder

type Cluster added in v0.3.0

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

func NewCluster added in v0.3.0

func NewCluster(cid ClusterID, name string, pid PropertyID) (*Cluster, error)

func (*Cluster) ID added in v0.3.0

func (c *Cluster) ID() ClusterID

func (*Cluster) Name added in v0.3.0

func (c *Cluster) Name() string

func (*Cluster) Property added in v0.3.0

func (c *Cluster) Property() PropertyID

func (*Cluster) Rename added in v0.3.0

func (c *Cluster) Rename(name string)

func (*Cluster) UpdateProperty added in v0.3.0

func (c *Cluster) UpdateProperty(pid PropertyID)

type ClusterID added in v0.4.0

type ClusterID = id.ClusterID

type ClusterList added in v0.3.0

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

func NewClusterList added in v0.3.0

func NewClusterList() *ClusterList

func NewClusterListFrom added in v0.3.0

func NewClusterListFrom(clusters []*Cluster) *ClusterList

func (*ClusterList) Add added in v0.3.0

func (tl *ClusterList) Add(clusters ...*Cluster)

func (*ClusterList) Clusters added in v0.3.0

func (tl *ClusterList) Clusters() []*Cluster

func (*ClusterList) Get added in v0.3.0

func (tl *ClusterList) Get(cid ClusterID) *Cluster

func (*ClusterList) Has added in v0.3.0

func (tl *ClusterList) Has(tid ClusterID) bool

func (*ClusterList) Properties added in v0.3.0

func (tl *ClusterList) Properties() []PropertyID

func (*ClusterList) Remove added in v0.3.0

func (tl *ClusterList) Remove(clusters ...ClusterID)

type ID added in v0.4.0

type ID = id.SceneID

type IDList added in v0.6.0

type IDList = id.SceneIDList

type LayerID added in v0.4.0

type LayerID = id.LayerID

type List added in v0.6.0

type List []*Scene

func (List) FilterByID added in v0.6.0

func (l List) FilterByID(ids ...ID) List

func (List) FilterByTeam added in v0.6.0

func (l List) FilterByTeam(teams ...TeamID) List

func (List) IDs added in v0.6.0

func (l List) IDs() []ID

type LockMode

type LockMode string

LockMode はシーンのロック状態を表します。

const (
	// LockModeFree はロックがかかっていない状態です。
	LockModeFree LockMode = ""
	// LockModePending は処理待ち中です。データの変更は無制限に変更はできます。
	LockModePending LockMode = "pending"
	// LockModePluginUpgrading はプラグインをアップグレード中です。シーンへの各種操作ができません。
	LockModePluginUpgrading LockMode = "plugin upgrading"
	// LockModeDatasetSyncing はデータセットを同期中です。シーンへの各種操作ができません。
	LockModeDatasetSyncing LockMode = "dataset syncing"
	// LockModePublishing はシーンを書き出し中です。シーンへの各種操作ができません。
	LockModePublishing LockMode = "publishing"
)

func (LockMode) IsLocked

func (l LockMode) IsLocked() bool

func (LockMode) Validate

func (l LockMode) Validate() (LockMode, bool)

type Plugin

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

func NewPlugin

func NewPlugin(plugin PluginID, property *PropertyID) *Plugin

func (*Plugin) Clone added in v0.4.0

func (s *Plugin) Clone() *Plugin

func (*Plugin) Plugin

func (s *Plugin) Plugin() PluginID

func (*Plugin) PluginRef added in v0.5.0

func (s *Plugin) PluginRef() *PluginID

func (*Plugin) Property

func (s *Plugin) Property() *PropertyID

type PluginExtensionID added in v0.4.0

type PluginExtensionID = id.PluginExtensionID

type PluginID added in v0.4.0

type PluginID = id.PluginID

type Plugins added in v0.4.0

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

func NewPlugins added in v0.4.0

func NewPlugins(plugins []*Plugin) *Plugins

func (*Plugins) Add added in v0.4.0

func (p *Plugins) Add(sp *Plugin)

func (*Plugins) Has added in v0.4.0

func (p *Plugins) Has(id PluginID) bool

func (*Plugins) HasPlugin added in v0.4.0

func (p *Plugins) HasPlugin(id PluginID) bool

func (*Plugins) HasPluginByName added in v0.5.0

func (p *Plugins) HasPluginByName(name string) bool

func (*Plugins) Plugin added in v0.4.0

func (p *Plugins) Plugin(pluginID PluginID) *Plugin

func (*Plugins) PluginByName added in v0.5.0

func (p *Plugins) PluginByName(name string) *Plugin

func (*Plugins) Plugins added in v0.4.0

func (p *Plugins) Plugins() []*Plugin

func (*Plugins) Properties added in v0.4.0

func (p *Plugins) Properties() []PropertyID

func (*Plugins) Property added in v0.4.0

func (p *Plugins) Property(id PluginID) *PropertyID

func (*Plugins) Remove added in v0.4.0

func (p *Plugins) Remove(pid PluginID)

func (*Plugins) Upgrade added in v0.4.0

func (p *Plugins) Upgrade(from, to PluginID, pr *PropertyID, deleteProperty bool)

type ProjectID added in v0.4.0

type ProjectID = id.ProjectID

type PropertyID added in v0.4.0

type PropertyID = id.PropertyID

type Scene

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

func (*Scene) Clusters added in v0.3.0

func (s *Scene) Clusters() *ClusterList

func (*Scene) CreatedAt

func (s *Scene) CreatedAt() time.Time

func (*Scene) ID

func (s *Scene) ID() ID

func (*Scene) IsTeamIncluded

func (s *Scene) IsTeamIncluded(teams []TeamID) bool

func (*Scene) Plugins added in v0.4.0

func (s *Scene) Plugins() *Plugins

func (*Scene) Project

func (s *Scene) Project() ProjectID

func (*Scene) Properties

func (s *Scene) Properties() []PropertyID

func (*Scene) Property

func (s *Scene) Property() PropertyID

func (*Scene) RootLayer

func (s *Scene) RootLayer() LayerID

func (*Scene) SetUpdatedAt

func (s *Scene) SetUpdatedAt(updatedAt time.Time)

func (*Scene) Team

func (s *Scene) Team() TeamID

func (*Scene) UpdatedAt

func (s *Scene) UpdatedAt() time.Time

func (*Scene) Widgets added in v0.4.0

func (s *Scene) Widgets() *Widgets

type TeamID added in v0.4.0

type TeamID = id.TeamID

type Widget

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

func MustWidget added in v0.5.0

func MustWidget(wid WidgetID, plugin PluginID, extension PluginExtensionID, property PropertyID, enabled bool, extended bool) *Widget

func NewWidget

func NewWidget(wid WidgetID, plugin PluginID, extension PluginExtensionID, property PropertyID, enabled, extended bool) (*Widget, error)

func (*Widget) Clone added in v0.4.0

func (w *Widget) Clone() *Widget

func (*Widget) Enabled

func (w *Widget) Enabled() bool

func (*Widget) Extended

func (w *Widget) Extended() bool

func (*Widget) Extension

func (w *Widget) Extension() PluginExtensionID

func (*Widget) ID

func (w *Widget) ID() WidgetID

func (*Widget) Plugin

func (w *Widget) Plugin() PluginID

func (*Widget) Property

func (w *Widget) Property() PropertyID

func (*Widget) SetEnabled

func (w *Widget) SetEnabled(enabled bool)

func (*Widget) SetExtended

func (w *Widget) SetExtended(extended bool)

func (*Widget) SetPlugin added in v0.5.0

func (w *Widget) SetPlugin(pid PluginID)

type WidgetAlignSystem

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

WidgetAlignSystem is the layout structure of any enabled widgets that will be displayed over the scene.

func NewWidgetAlignSystem

func NewWidgetAlignSystem() *WidgetAlignSystem

NewWidgetAlignSystem returns a new widget align system.

func (*WidgetAlignSystem) Area

func (*WidgetAlignSystem) Find

func (was *WidgetAlignSystem) Find(wid WidgetID) (int, WidgetLocation)

func (*WidgetAlignSystem) Move

func (was *WidgetAlignSystem) Move(wid WidgetID, location WidgetLocation, index int)

func (*WidgetAlignSystem) Remove

func (was *WidgetAlignSystem) Remove(wid WidgetID)

Remove a widget from the align system.

func (*WidgetAlignSystem) SetZone

func (w *WidgetAlignSystem) SetZone(t WidgetZoneType, z *WidgetZone)

func (*WidgetAlignSystem) Zone

func (was *WidgetAlignSystem) Zone(zone WidgetZoneType) *WidgetZone

Zone will return a specific zone in the align system.

type WidgetAlignType

type WidgetAlignType string
const (
	WidgetAlignStart    WidgetAlignType = "start"
	WidgetAlignCentered WidgetAlignType = "centered"
	WidgetAlignEnd      WidgetAlignType = "end"
)

type WidgetArea

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

WidgetArea has the widgets and alignment information found in each part area of a section.

func NewWidgetArea

func NewWidgetArea(widgetIds []WidgetID, align WidgetAlignType) *WidgetArea

func (*WidgetArea) Add

func (a *WidgetArea) Add(wid WidgetID, index int)

func (*WidgetArea) AddAll

func (a *WidgetArea) AddAll(wids []WidgetID)

func (*WidgetArea) Alignment

func (a *WidgetArea) Alignment() WidgetAlignType

Alignment will return the alignment of a specific area.

func (*WidgetArea) Find

func (a *WidgetArea) Find(wid WidgetID) int

func (*WidgetArea) Move

func (a *WidgetArea) Move(from, to int)

func (*WidgetArea) Remove

func (a *WidgetArea) Remove(wid WidgetID)

func (*WidgetArea) SetAlignment

func (a *WidgetArea) SetAlignment(at WidgetAlignType)

func (*WidgetArea) WidgetIDs

func (a *WidgetArea) WidgetIDs() WidgetIDList

WidgetIds will return a slice of widget ids from a specific area.

type WidgetAreaType

type WidgetAreaType string
var (
	WidgetAreaTop    WidgetAreaType = "top"
	WidgetAreaMiddle WidgetAreaType = "middle"
	WidgetAreaBottom WidgetAreaType = "bottom"
)

type WidgetID added in v0.4.0

type WidgetID = id.WidgetID

type WidgetIDList added in v0.6.1

type WidgetIDList = id.WidgetIDList

type WidgetLocation

type WidgetLocation struct {
	Zone    WidgetZoneType
	Section WidgetSectionType
	Area    WidgetAreaType
}

func (WidgetLocation) Horizontal

func (l WidgetLocation) Horizontal() bool

func (WidgetLocation) Vertical

func (l WidgetLocation) Vertical() bool

type WidgetSection

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

WidgetSection is the structure of each section of the align system.

func NewWidgetSection

func NewWidgetSection() *WidgetSection

func (*WidgetSection) Area

func (*WidgetSection) Find

func (s *WidgetSection) Find(wid WidgetID) (int, WidgetAreaType)

func (*WidgetSection) Remove

func (s *WidgetSection) Remove(wid WidgetID)

func (*WidgetSection) SetArea

func (s *WidgetSection) SetArea(t WidgetAreaType, a *WidgetArea)

type WidgetSectionType

type WidgetSectionType string
const (
	WidgetSectionLeft   WidgetSectionType = "left"
	WidgetSectionCenter WidgetSectionType = "center"
	WidgetSectionRight  WidgetSectionType = "right"
)

type WidgetZone

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

WidgetZone is the structure of each layer (inner and outer) of the align system.

func NewWidgetZone

func NewWidgetZone() *WidgetZone

func (*WidgetZone) Find

func (*WidgetZone) Remove

func (z *WidgetZone) Remove(wid WidgetID)

func (*WidgetZone) Section

func (wz *WidgetZone) Section(s WidgetSectionType) *WidgetSection

func (*WidgetZone) SetSection

func (z *WidgetZone) SetSection(t WidgetSectionType, s *WidgetSection)

type WidgetZoneType

type WidgetZoneType string
const (
	WidgetZoneInner WidgetZoneType = "inner"
	WidgetZoneOuter WidgetZoneType = "outer"
)

type Widgets added in v0.4.0

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

func NewWidgets added in v0.4.0

func NewWidgets(w []*Widget, a *WidgetAlignSystem) *Widgets

func (*Widgets) Add added in v0.4.0

func (w *Widgets) Add(sw *Widget)

func (*Widgets) Alignment added in v0.5.0

func (w *Widgets) Alignment() *WidgetAlignSystem

func (*Widgets) Has added in v0.4.0

func (w *Widgets) Has(wid WidgetID) bool

func (*Widgets) Properties added in v0.4.0

func (w *Widgets) Properties() []PropertyID

func (*Widgets) Remove added in v0.4.0

func (w *Widgets) Remove(wid WidgetID)

func (*Widgets) RemoveAllByPlugin added in v0.4.0

func (w *Widgets) RemoveAllByPlugin(p PluginID, e *PluginExtensionID) (res []PropertyID)

func (*Widgets) UpgradePlugin added in v0.5.0

func (w *Widgets) UpgradePlugin(oldp, newp PluginID)

func (*Widgets) Widget added in v0.4.0

func (w *Widgets) Widget(wid WidgetID) *Widget

func (*Widgets) Widgets added in v0.4.0

func (w *Widgets) Widgets() []*Widget

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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