types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ApplicationName = "rocketblend-desktop"
View Source
const DetailFileName = "rocketdesk.json"
View Source
const IgnoreFileName = ".rocketignore"
View Source
const PackageFileName = types.PackageFileName

Variables

View Source
var ErrNotImplement = errors.New("not implemented")

Functions

This section is empty.

Types

type AddPackageOperationOpts

type AddPackageOperationOpts struct {
	ID          uuid.UUID `json:"id"`
	OperationID uuid.UUID `json:"operationID"`
}

type AddPackageOpts

type AddPackageOpts struct {
	Reference reference.Reference `json:"reference"`
	Update    bool                `json:"update"`
}

type AddProjectPackageOpts

type AddProjectPackageOpts struct {
	ID        uuid.UUID           `json:"id"`
	Reference reference.Reference `json:"reference"`
}

type Aggregate

type Aggregate struct {
	Domain string  `json:"domain"`
	Name   string  `json:"name"`
	Sum    int     `json:"sum"`
	Avg    float64 `json:"avg"`
	Count  int     `json:"count"`
	Min    int     `json:"min"`
	Max    int     `json:"max"`
}

type AggregateMetricsResult

type AggregateMetricsResult struct {
	Aggregate *Aggregate `json:"aggregate,omitempty"`
}

type Blender

type Blender interface {
	types.Blender
}

type Catalog

type Catalog interface {
	GetPackage(ctx context.Context, opts *GetPackageOpts) (*GetPackageResponse, error)
	ListPackages(ctx context.Context, opts ...listoption.ListOption) (*ListPackagesResponse, error) // TODO: Change opts struct.

	AddPackageOperation(ctx context.Context, opts *AddPackageOperationOpts) error
	RemovePackageOperation(ctx context.Context, opts *RemovePackageOperationOpts) error

	AddPackage(ctx context.Context, opts *AddPackageOpts) error

	InstallPackage(ctx context.Context, opts *InstallPackageOpts) error
	UninstallPackage(ctx context.Context, opts *UninstallPackageOpts) error

	RefreshPackages(ctx context.Context) error

	Close() error
}

type Config

type Config struct {
	Project ProjectConfig `mapstructure:"project"`
	Package PackageConfig `mapstructure:"package"`
	Feature FeatureConfig `mapstructure:"feature"`
}

type Configurator

type Configurator interface {
	Get() (config *Config, err error)
	GetAllValues() map[string]interface{}
	GetValueByString(key string) string
	SetValueByString(key string, value string) error
	Save(config *Config) error
	Path() string
}

type Container

type Container interface {
	GetLogger() (Logger, error)
	GetValidator() (Validator, error)

	GetDispatcher() (Dispatcher, error)
	GetTracker() (Tracker, error)
	GetOperator() (Operator, error)

	GetConfigurator() (Configurator, error)

	GetRBConfigurator() (rbtypes.Configurator, error)
	GetRBDriver() (rbtypes.Driver, error)

	GetBlender() (rbtypes.Blender, error)

	GetStore() (Store, error)
	GetPortfolio() (Portfolio, error)
	GetCatalog() (Catalog, error)
}

type CreateMetricOpts

type CreateMetricOpts struct {
	Domain string `json:"domain,omitempty"`
	Name   string `json:"Name,omitempty"`
	Value  int    `json:"value,omitempty"`
}

type CreateProjectOpts

type CreateProjectOpts struct {
	DisplayName   string              `json:"displayName"`
	BlendFileName string              `json:"blendFileName"`
	Path          string              `json:"path"`
	Build         reference.Reference `json:"build"`
}

type CreateProjectResult

type CreateProjectResult struct {
	ID uuid.UUID
}

type Definition

type Definition struct {
	types.Package
}

type DeleteMetricOpts

type DeleteMetricOpts struct {
	ID uuid.UUID `json:"id"`
}

type Dependency

type Dependency struct {
	Reference reference.Reference `json:"reference"`
	Type      enums.PackageType   `json:"type"`
}

type Detail

type Detail struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	Tags      []string  `json:"tags,omitempty"`
	MediaPath string    `json:"mediaPath,omitempty"`
}

type Dispatcher

type Dispatcher interface {
	Subscribe(ctx context.Context, name string, fn interface{}, maxTrigger int) (context.CancelFunc, error)
	EmitEvent(ctx context.Context, name string, params ...interface{}) error
	Broadcast(ctx context.Context, params ...interface{}) error
	EventExists(name string) bool
	ListEvents() []string
	FilterEvents(filterFunc func(string, []EventListener) bool) []string
	CountListeners(eventName string) int
	Close() error
}

type EventListener

type EventListener struct {
	ID    string
	Count *int
	FN    interface{}
}

type Eventer

type Eventer interface {
	StopPropagation()
	IsPropagationStopped() bool
}

type FeatureConfig

type FeatureConfig struct {
	Addon     bool `mapstructure:"addon"`
	Developer bool `mapstructure:"developer"`
}

type FilterMetricsOpts

type FilterMetricsOpts struct {
	Domain    string    `json:"domain,omitempty"`
	Name      string    `json:"name,omitempty"`
	StartTime time.Time `json:"startTime,omitempty"`
	EndTime   time.Time `json:"endTime,omitempty"`
}

type GetMetricOpts

type GetMetricOpts struct {
	ID uuid.UUID `json:"id"`
}

type GetMetricResult

type GetMetricResult struct {
	Metric *Metric `json:"metric,omitempty"`
}

type GetPackageOpts

type GetPackageOpts struct {
	ID uuid.UUID `json:"id"`
}

type GetPackageResponse

type GetPackageResponse struct {
	Package *Package `json:"package,omitempty"`
}

type GetProjectOpts

type GetProjectOpts struct {
	ID uuid.UUID `json:"id"`
}

type GetProjectResponse

type GetProjectResponse struct {
	Project *Project `json:"project,omitempty"`
}

type Index

type Index struct {
	ID         uuid.UUID           `json:"id,omitempty"`
	Type       indextype.IndexType `json:"type,omitempty"`
	Reference  string              `json:"reference,omitempty"`
	Name       string              `json:"name,omitempty"`
	Category   string              `json:"category,omitempty"`
	State      string              `json:"state"`
	Resources  []string            `json:"resources,omitempty"`
	Operations []string            `json:"operations,omitempty"`
	Date       time.Time           `json:"date,omitempty"`
	Data       string              `json:"data,omitempty"`
}

func (*Index) BleveType

func (v *Index) BleveType() string

type IndexType

type IndexType int
const (
	IndexTypeUnknown IndexType = iota
	IndexTypeProject
	IndexTypePackage
	IndexTypeOperation
	IndexTypeMetric
)

func PackageTypeFromString

func PackageTypeFromString(str string) IndexType

func (IndexType) Int

func (p IndexType) Int() int

func (IndexType) MarshalJSON

func (p IndexType) MarshalJSON() ([]byte, error)

func (IndexType) String

func (p IndexType) String() string

func (*IndexType) UnmarshalJSON

func (p *IndexType) UnmarshalJSON(b []byte) error

type InstallPackageOpts

type InstallPackageOpts struct {
	ID uuid.UUID `json:"id"`
}

type ListMetricsResult

type ListMetricsResult struct {
	Metrics []*Metric `json:"metrics,omitempty"`
}

type ListPackagesResponse

type ListPackagesResponse struct {
	Packages []*Package `json:"packages,omitempty"`
}

type ListProjectsResponse

type ListProjectsResponse struct {
	Projects []*Project `json:"projects,omitempty"`
}

type Logger

type Logger interface {
	types.Logger
}

type Media

type Media struct {
	FilePath  string `json:"filePath"`
	URL       string `json:"url"`
	Splash    bool   `json:"splash"`
	Thumbnail bool   `json:"thumbnail"`
}

type Metric

type Metric struct {
	ID         uuid.UUID `json:"id"`
	Domain     string    `json:"domain"`
	Name       string    `json:"name"`
	Value      int       `json:"value"`
	RecordedAt time.Time `json:"recordedAt"`
}

type Operation

type Operation struct {
	ID        uuid.UUID   `json:"id"`
	Completed bool        `json:"completed"`
	ErrorMsg  string      `json:"error,omitempty"`
	Result    interface{} `json:"result,omitempty"`
}

type Operator

type Operator interface {
	Create(ctx context.Context, opFunc func(ctx context.Context, opid uuid.UUID) (interface{}, error)) (uuid.UUID, error)
	Get(ctx context.Context, opid uuid.UUID) (*Operation, error)
	List(ctx context.Context, opts ...listoption.ListOption) ([]*Operation, error)
	Cancel(opid uuid.UUID) error
}

type Package

type Package struct {
	ID               uuid.UUID           `json:"id"`
	Type             enums.PackageType   `json:"type"`
	State            enums.PackageState  `json:"state"`
	Reference        reference.Reference `json:"reference"`
	Name             string              `json:"name"`
	Author           string              `json:"author"`
	Tag              string              `json:"tag"`
	Path             string              `json:"path"`
	Verified         bool                `json:"verified"`
	InstallationPath string              `json:"installationPath"`
	Operations       []string            `json:"operations"`
	Platform         types.Platform      `json:"platform"`
	URI              *types.URI          `json:"uri"`
	Version          *semver.Version     `json:"version"`
	Progress         *Progress           `json:"progress,omitempty"`
	UpdatedAt        time.Time           `json:"updatedAt"`
}

type PackageConfig

type PackageConfig struct {
	Watcher  WatcherConfig `mapstructure:"watcher"`
	AutoPull bool          `mapstructure:"autoPull"`
}

type Portfolio

type Portfolio interface {
	GetProject(ctx context.Context, opts *GetProjectOpts) (*GetProjectResponse, error)
	ListProjects(ctx context.Context, opts ...listoption.ListOption) (*ListProjectsResponse, error)

	CreateProject(ctx context.Context, opts *CreateProjectOpts) (*CreateProjectResult, error)
	UpdateProject(ctx context.Context, opts *UpdateProjectOpts) error
	AddProjectPackage(ctx context.Context, opts *AddProjectPackageOpts) error
	RemoveProjectPackage(ctx context.Context, opts *RemoveProjectPackageOpts) error

	//RenderProject(ctx context.Context, id uuid.UUID) error
	RunProject(ctx context.Context, opts *RunProjectOpts) error

	Refresh(ctx context.Context) error

	Close() error
}

type Progress

type Progress struct {
	CurrentBytes   int64   `json:"currentBytes"`
	TotalBytes     int64   `json:"totalBytes"`
	BytesPerSecond float64 `json:"bytesPerSecond"`
}

type Project

type Project struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
	Tags []string  `json:"tags"`
	Path string    `json:"path"`

	MediaPath string `json:"mediaPath"`
	FileName  string `json:"fileName"`

	Dependencies []*Dependency `json:"dependencies"`
	Media        []*Media      `json:"media"`

	Strict bool `json:"strict"`

	Version   string    `json:"version"`
	UpdatedAt time.Time `json:"updatedAt"`
}

func (*Project) Detail

func (p *Project) Detail() *Detail

func (*Project) HasDependency

func (p *Project) HasDependency(dep reference.Reference) bool

func (*Project) Profile

func (p *Project) Profile() *rbtypes.Profile

type ProjectConfig

type ProjectConfig struct {
	Paths   []string      `mapstructure:"paths"`
	Watcher WatcherConfig `mapstructure:"watcher"`
}

type RBConfigurator

type RBConfigurator interface {
	types.Configurator
}

type RBDriver

type RBDriver interface {
	types.Driver
}

type RBRepository

type RBRepository interface {
	types.Repository
}

type RemovePackageOperationOpts

type RemovePackageOperationOpts struct {
	ID          uuid.UUID `json:"id"`
	OperationID uuid.UUID `json:"operationID"`
}

type RemoveProjectPackageOpts

type RemoveProjectPackageOpts struct {
	ID        uuid.UUID           `json:"id"`
	Reference reference.Reference `json:"reference"`
}

type RunProjectOpts

type RunProjectOpts struct {
	ID uuid.UUID `json:"id"`
}

type Store

type Store interface {
	List(ctx context.Context, opts ...listoption.ListOption) ([]*Index, error)
	Get(ctx context.Context, id uuid.UUID) (*Index, error)
	Insert(ctx context.Context, index *Index) error
	Remove(ctx context.Context, id uuid.UUID) error
	RemoveByReference(ctx context.Context, path string) error

	Close() error
}

type Tracker

type Tracker interface {
	GetMetric(ctx context.Context, opts *GetMetricOpts) (*GetMetricResult, error)
	ListMetrics(ctx context.Context, opts *FilterMetricsOpts) (*ListMetricsResult, error)
	AggregateMetrics(ctx context.Context, opts *FilterMetricsOpts) (*AggregateMetricsResult, error)

	CreateMetric(ctx context.Context, opts *CreateMetricOpts) error
	DeleteMetric(ctx context.Context, opts *DeleteMetricOpts) error
}

type UninstallPackageOpts

type UninstallPackageOpts struct {
	ID uuid.UUID `json:"id"`
}

type UpdateProjectOpts

type UpdateProjectOpts struct {
	ID   uuid.UUID `json:"id"`
	Name *string   `json:"name"`
	Tags *[]string `json:"tags"`
}

type Validator

type Validator interface {
	types.Validator
}

type Watcher

type Watcher interface {
	Close() error
	SetPaths(paths ...string) error
}

type WatcherConfig

type WatcherConfig struct {
	FileExtensions []string `mapstructure:"fileExtensions"`
}

Jump to

Keyboard shortcuts

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