resolvers

package
v0.0.0-...-1fa5987 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchema

func NewSchema(r *RootResolver) *graphql.Schema

func OpenDB

func OpenDB(ctx context.Context, dbPath string) (*sqlx.DB, error)

Types

type ClusterResolver

type ClusterResolver struct {
	Q *RootResolver
	ClusterRow
}

func (*ClusterResolver) Default

func (r *ClusterResolver) Default() bool

SEE NOTE [DEFAULT_CLUSTER].

func (*ClusterResolver) Environment

func (r *ClusterResolver) Environment(ctx context.Context) (*EnvironmentResolver, error)

Cluster environments are not influenced by manifest files and so can be resolved directly. XXX If the environment is observed to change, should that trigger a reconciliation? XXX Alternatively, should it alert the user and allow them to take some action?

type ClusterRow

type ClusterRow struct {
	ID                   string     `db:"id"`
	Name                 string     `db:"name"`
	EnvironmentVariables JSONObject `db:"environment_variables"`
	Updated              Instant    `db:"updated"`
}

type ComponentDefinition

type ComponentDefinition struct {
	Type        string
	Name        string
	Key         string
	Spec        CueValue
	Environment JSONObject
}

func (ComponentDefinition) Ident

func (def ComponentDefinition) Ident() string

Composite-key for uniquely identifying components within a parent. If a discriminator key is not provided during rendering, a hash of the component spec is used. TODO: Should renaming a component necessarily force a new identity?

type ComponentResolver

type ComponentResolver struct {
	Q *QueryResolver
	ComponentRow
}

func (*ComponentResolver) AsNetwork

func (*ComponentResolver) AsProcess

func (*ComponentResolver) AsStore

func (*ComponentResolver) Children

func (r *ComponentResolver) Children(ctx context.Context) ([]*ComponentResolver, error)

func (*ComponentResolver) Configuration

func (r *ComponentResolver) Configuration(ctx context.Context, args struct {
	Recursive *bool
	Final     *bool
}) (string, error)

func (*ComponentResolver) Environment

func (r *ComponentResolver) Environment(ctx context.Context) (*EnvironmentResolver, error)

func (*ComponentResolver) Model

func (r *ComponentResolver) Model() (obj JSONObject, err error)

func (*ComponentResolver) Parent

func (*ComponentResolver) Reconciling

func (r *ComponentResolver) Reconciling() bool

func (*ComponentResolver) Resources

func (r *ComponentResolver) Resources(ctx context.Context) ([]*ResourceResolver, error)

func (*ComponentResolver) Running

func (r *ComponentResolver) Running() bool

func (*ComponentResolver) Stack

type ComponentRow

type ComponentRow struct {
	ID                   string     `db:"id"`
	StackID              string     `db:"stack_id"`
	ParentID             *string    `db:"parent_id"`
	Type                 string     `db:"type"`
	Name                 string     `db:"name"`
	Key                  string     `db:"key"`
	Spec                 CueValue   `db:"spec"`
	RawModel             RawJSON    `db:"model"`
	EnvironmentVariables JSONObject `db:"environment_variables"`
	Disposed             *Instant   `db:"disposed"`
}

type Entity

type Entity struct {
	Type       string
	ID         string
	Underlying any
}

type EntityRef

type EntityRef struct {
	Type string
	ID   string
}

type EnvironmentResolver

type EnvironmentResolver struct {
	Parent *EnvironmentResolver
	Source EnvironmentSource
	Locals []*EnvironmentVariableResolver
}

func (*EnvironmentResolver) AsMap

func (r *EnvironmentResolver) AsMap() JSONObject

func (*EnvironmentResolver) Variables

type EnvironmentSource

type EnvironmentSource interface {
	Environment(ctx context.Context) (*EnvironmentResolver, error)
}

type EnvironmentVariableResolver

type EnvironmentVariableResolver struct {
	Name      string
	Value     *string
	Source    EnvironmentSource
	Sensitive bool
}

type ErrorResolver

type ErrorResolver struct {
	Message string
}

type EventPageResolver

type EventPageResolver struct {
	Items      []*EventResolver
	PrevCursor ULID
	NextCursor ULID
}

type EventResolver

type EventResolver struct {
	Q *RootResolver
	EventRow
}

func (*EventResolver) Component

func (r *EventResolver) Component(ctx context.Context) (*ComponentResolver, error)

func (*EventResolver) Job

func (r *EventResolver) Job() *JobResolver

func (*EventResolver) Source

func (r *EventResolver) Source(ctx context.Context) (source StreamSourceResolver, err error)

func (*EventResolver) SourceID

func (r *EventResolver) SourceID() string

func (*EventResolver) Stack

func (r *EventResolver) Stack(ctx context.Context) (*StackResolver, error)

func (*EventResolver) Stream

func (r *EventResolver) Stream() *StreamResolver

func (*EventResolver) Task

func (r *EventResolver) Task(ctx context.Context) (*TaskResolver, error)

func (*EventResolver) Workspace

func (r *EventResolver) Workspace(ctx context.Context) (*WorkspaceResolver, error)

type EventRow

type EventRow struct {
	ULID        ULID       `db:"ulid"`
	Type        string     `db:"type"`
	Message     string     `db:"message"`
	Tags        JSONObject `db:"tags"`
	SourceType  string     `db:"source_type"`
	WorkspaceID *string    `db:"workspace_id"`
	StackID     *string    `db:"stack_id"`
	ComponentID *string    `db:"component_id"`
	JobID       *string    `db:"job_id"`
	TaskID      *string    `db:"task_id"`
}

func (*EventRow) ID

func (r *EventRow) ID() string

func (*EventRow) Timestamp

func (r *EventRow) Timestamp() Instant

type FileResolver

type FileResolver struct {
	Path        string
	HostPath    string
	IsDirectory bool
	// contains filtered or unexported fields
}

func (*FileResolver) Children

func (r *FileResolver) Children() ([]*FileResolver, error)

func (*FileResolver) Content

func (r *FileResolver) Content() (string, error)

func (*FileResolver) Name

func (r *FileResolver) Name() string

func (*FileResolver) ParentPath

func (r *FileResolver) ParentPath() *string

func (*FileResolver) Size

func (r *FileResolver) Size() (float64, error)

type FileSystemResolver

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

func (*FileSystemResolver) File

func (r *FileSystemResolver) File(ctx context.Context, args struct {
	Path string
}) (*FileResolver, error)

func (*FileSystemResolver) FileOrHome

func (r *FileSystemResolver) FileOrHome(ctx context.Context, args struct {
	Path *string
}) (*FileResolver, error)

func (*FileSystemResolver) HomePath

func (r *FileSystemResolver) HomePath() (string, error)

func (*FileSystemResolver) Root

type GraphqlLogger

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

func NewGraphqlLogger

func NewGraphqlLogger(logger logging.Logger) *GraphqlLogger

func (*GraphqlLogger) LogPanic

func (gl *GraphqlLogger) LogPanic(ctx context.Context, value any)

Adapted from graphql-gopher's DefaultLogger implementation.

type JobResolver

type JobResolver struct {
	Q *RootResolver
	// Jobs are synthetic entities with an ID equal to that of their root task.
	ID string
}

func (*JobResolver) RootTask

func (r *JobResolver) RootTask(ctx context.Context) (*TaskResolver, error)

func (*JobResolver) Stream

func (r *JobResolver) Stream() *StreamResolver

func (*JobResolver) Tasks

func (r *JobResolver) Tasks(ctx context.Context) ([]*TaskResolver, error)

func (*JobResolver) URL

func (r *JobResolver) URL() string

func (*JobResolver) Updated

func (r *JobResolver) Updated(ctx context.Context) (Instant, error)

type ManifestResolver

type ManifestResolver struct {
	Format string
	File   *FileResolver
	// contains filtered or unexported fields
}

func (*ManifestResolver) Content

func (r *ManifestResolver) Content() (string, error)

func (*ManifestResolver) Formatted

func (r *ManifestResolver) Formatted() (string, error)

func (*ManifestResolver) HostPath

func (r *ManifestResolver) HostPath() *string

type MutationResolver

type MutationResolver = RootResolver

func (*MutationResolver) AcquireTask

func (r *MutationResolver) AcquireTask(ctx context.Context, args struct {
	WorkerID string
	JobID    *string
}) (*TaskResolver, error)

func (*MutationResolver) AttachVault

func (r *MutationResolver) AttachVault(ctx context.Context, args struct {
	StackID string
	URL     string
}) (*VaultResolver, error)

func (*MutationResolver) BuildWorkspace

func (r *MutationResolver) BuildWorkspace(ctx context.Context, args struct {
	Workspace string
}) (*VoidResolver, error)

func (*MutationResolver) BuildWorkspaceComponents

func (r *MutationResolver) BuildWorkspaceComponents(ctx context.Context, args struct {
	Workspace  string
	Components []string
}) (*VoidResolver, error)

func (*MutationResolver) BusyWork

func (r *MutationResolver) BusyWork(ctx context.Context, args struct {
	Size     int32
	Width    *int32
	Depth    *int32
	Length   *int32
	FailRate *float64
}) (*VoidResolver, error)

func (*MutationResolver) CancelJob

func (r *MutationResolver) CancelJob(ctx context.Context, args struct {
	ID string
}) (*VoidResolver, error)

func (*MutationResolver) CancelResourceOperation

func (r *MutationResolver) CancelResourceOperation(ctx context.Context, args struct {
	Ref string
}) (*ResourceResolver, error)

func (*MutationResolver) CancelTask

func (r *MutationResolver) CancelTask(ctx context.Context, args struct {
	ID string
}) (*VoidResolver, error)

func (*MutationResolver) CreateComponent

func (r *MutationResolver) CreateComponent(ctx context.Context, args struct {
	Stack       string
	Name        string
	Type        string
	Spec        CueValue
	Environment *JSONObject
}) (*ReconciliationResolver, error)

func (*MutationResolver) CreateEvent

func (r *MutationResolver) CreateEvent(ctx context.Context, args struct {
	SourceType string
	SourceID   string
	Type       string
	Message    string
}) (*EventResolver, error)

func (*MutationResolver) CreateJob

func (r *MutationResolver) CreateJob(ctx context.Context, args struct {
	Mutation  string
	Arguments JSONObject
}) (*JobResolver, error)

func (*MutationResolver) CreateProject

func (r *MutationResolver) CreateProject(ctx context.Context, args struct {
	DisplayName *string
}) (*ProjectResolver, error)

func (*MutationResolver) CreateResource

func (r *MutationResolver) CreateResource(ctx context.Context, args struct {
	Type      string
	Model     JSONObject
	Project   *string
	Stack     *string
	Component *string
	Adopt     *bool
}) (*ResourceResolver, error)

func (*MutationResolver) CreateStack

func (r *MutationResolver) CreateStack(ctx context.Context, args struct {
	Workspace   *string
	Name        *string
	Cluster     *string
	Environment *JSONObject
}) (*StackResolver, error)

func (*MutationResolver) CreateTask

func (r *MutationResolver) CreateTask(ctx context.Context, args struct {
	Mutation  string
	Arguments JSONObject
	Key       *string
}) (*TaskResolver, error)

func (*MutationResolver) CreateWorkspace

func (r *MutationResolver) CreateWorkspace(ctx context.Context, args struct {
	Root      string
	ProjectID *string
}) (*WorkspaceResolver, error)

func (*MutationResolver) DestroyComponent

func (r *MutationResolver) DestroyComponent(ctx context.Context, args struct {
	Stack *string
	Ref   string
}) (*ReconciliationResolver, error)

func (*MutationResolver) DestroyComponents

func (r *MutationResolver) DestroyComponents(ctx context.Context, args struct {
	Stack *string
	Refs  []string
}) (*ReconciliationResolver, error)

func (*MutationResolver) DestroyStack

func (r *MutationResolver) DestroyStack(ctx context.Context, args struct {
	Ref string
}) (*ReconciliationResolver, error)

func (*MutationResolver) DestroyWorkspace

func (r *MutationResolver) DestroyWorkspace(ctx context.Context, args struct {
	Ref string
}) (*ReconciliationResolver, error)

func (*MutationResolver) DisposeResource

func (r *MutationResolver) DisposeResource(ctx context.Context, args struct {
	Ref string
}) (*VoidResolver, error)

func (*MutationResolver) FinishTask

func (r *MutationResolver) FinishTask(ctx context.Context, args struct {
	ID    string
	Error *string
}) (*VoidResolver, error)

func (*MutationResolver) ForgetResource

func (r *MutationResolver) ForgetResource(ctx context.Context, args struct {
	Ref string
}) (*VoidResolver, error)

func (*MutationResolver) ForgetVault

func (r *MutationResolver) ForgetVault(ctx context.Context, args struct {
	ID string
}) (*VoidResolver, error)

func (*MutationResolver) FormatManifest

func (r *MutationResolver) FormatManifest(ctx context.Context, args struct {
	Workspace string
	Format    *string
	Path      *string
}) (*VoidResolver, error)

func (*MutationResolver) InitializeResource

func (r *MutationResolver) InitializeResource(ctx context.Context, args struct {
	Ref   string
	Model JSONObject
}) (*ResourceResolver, error)

func (*MutationResolver) Migrate

func (r *MutationResolver) Migrate(ctx context.Context) error

func (*MutationResolver) ReconcileComponent

func (r *MutationResolver) ReconcileComponent(ctx context.Context, args struct {
	Stack *string
	Ref   string
}) (*VoidResolver, error)

func (*MutationResolver) ReconcileComponent_label

func (r *MutationResolver) ReconcileComponent_label(ctx context.Context, args struct {
	Stack *string
	Ref   string
}) (string, error)

func (*MutationResolver) ReconcileStack

func (r *MutationResolver) ReconcileStack(ctx context.Context, args struct {
	Ref string
}) (*VoidResolver, error)

func (*MutationResolver) ReconcileStack_label

func (r *MutationResolver) ReconcileStack_label(ctx context.Context, args struct {
	Ref string
}) (string, error)

func (*MutationResolver) RefreshCluster

func (r *MutationResolver) RefreshCluster(ctx context.Context, args struct {
	Ref string
}) (*ClusterResolver, error)

func (*MutationResolver) RefreshResource

func (r *MutationResolver) RefreshResource(ctx context.Context, args struct {
	Ref string
}) (*ResourceResolver, error)

func (*MutationResolver) RefreshStack

func (r *MutationResolver) RefreshStack(ctx context.Context, args struct {
	Ref string
}) (*ReconciliationResolver, error)

func (*MutationResolver) RefreshWorkspace

func (r *MutationResolver) RefreshWorkspace(ctx context.Context, args struct {
	Workspace string
}) (*VoidResolver, error)

func (*MutationResolver) RefreshWorkspaceComponents

func (r *MutationResolver) RefreshWorkspaceComponents(ctx context.Context, args struct {
	Workspace  string
	Components []string
}) (*VoidResolver, error)

func (*MutationResolver) RestartWorkspace

func (r *MutationResolver) RestartWorkspace(ctx context.Context, args struct {
	Workspace string
}) (*VoidResolver, error)

func (*MutationResolver) RestartWorkspaceComponents

func (r *MutationResolver) RestartWorkspaceComponents(ctx context.Context, args struct {
	Workspace  string
	Components []string
}) (*VoidResolver, error)

func (*MutationResolver) SetWorkspaceStack

func (r *MutationResolver) SetWorkspaceStack(ctx context.Context, args struct {
	Workspace string
	Stack     *string
}) (*StackResolver, error)

func (*MutationResolver) Sleep

func (r *MutationResolver) Sleep(ctx context.Context, args struct {
	Seconds float64
}) (*VoidResolver, error)

func (*MutationResolver) StartTask

func (r *MutationResolver) StartTask(ctx context.Context, args struct {
	ID       string
	WorkerID string
}) (*TaskResolver, error)

func (*MutationResolver) StartWorkspace

func (r *MutationResolver) StartWorkspace(ctx context.Context, args struct {
	Workspace string
}) (*VoidResolver, error)

func (*MutationResolver) StartWorkspaceComponents

func (r *MutationResolver) StartWorkspaceComponents(ctx context.Context, args struct {
	Workspace  string
	Components []string
}) (*VoidResolver, error)

func (*MutationResolver) StopDaemon

func (r *MutationResolver) StopDaemon() *VoidResolver

func (*MutationResolver) StopWorkspace

func (r *MutationResolver) StopWorkspace(ctx context.Context, args struct {
	Workspace string
}) (*VoidResolver, error)

func (*MutationResolver) StopWorkspaceComponents

func (r *MutationResolver) StopWorkspaceComponents(ctx context.Context, args struct {
	Workspace  string
	Components []string
}) (*VoidResolver, error)

func (*MutationResolver) Tick

func (r *MutationResolver) Tick(ctx context.Context, args struct {
	Limit *int32
}) <-chan Instant

func (*MutationResolver) UpdateCluster

func (r *MutationResolver) UpdateCluster(ctx context.Context, args struct {
	Ref         string
	Environment *JSONObject
}) (*ClusterResolver, error)

func (*MutationResolver) UpdateComponent

func (r *MutationResolver) UpdateComponent(ctx context.Context, args struct {
	Stack   *string
	Ref     string
	NewSpec *CueValue
	NewName *string
}) (*ReconciliationResolver, error)

func (*MutationResolver) UpdateResource

func (r *MutationResolver) UpdateResource(ctx context.Context, args struct {
	Ref   string
	Model JSONObject
}) (*ResourceResolver, error)

func (*MutationResolver) UpdateTask

func (r *MutationResolver) UpdateTask(ctx context.Context, args struct {
	ID       string
	WorkerID string
	Progress *ProgressInput
}) (*TaskResolver, error)

type NetworkComponentResolver

type NetworkComponentResolver struct {
	NetworkResolver

	ComponentID string
	Name        string
}

func (*NetworkComponentResolver) Component

type NetworkResolver

type NetworkResolver struct {
	Q    *RootResolver
	Type string
}

type ProcessComponentResolver

type ProcessComponentResolver struct {
	ProcessResolver

	ComponentID string
	Name        string
}

func (*ProcessComponentResolver) Component

type ProcessResolver

type ProcessResolver struct {
	Q    *RootResolver
	Type string
}

func (*ProcessResolver) CPUPercent

func (r *ProcessResolver) CPUPercent() *float64

func (*ProcessResolver) Environment

func (r *ProcessResolver) Environment() *EnvironmentResolver

func (*ProcessResolver) Ports

func (r *ProcessResolver) Ports() *[]int32

func (*ProcessResolver) ResidentBytes

func (r *ProcessResolver) ResidentBytes() *int32

func (*ProcessResolver) Started

func (r *ProcessResolver) Started() *Instant

type ProgressInput

type ProgressInput struct {
	Current int32
	Total   int32
}

type ProgressResolver

type ProgressResolver struct {
	Current int32
	Total   int32
}

func (*ProgressResolver) Percent

func (r *ProgressResolver) Percent() float64

type ProjectResolver

type ProjectResolver struct {
	Q *QueryResolver
	ProjectRow
}

func (*ProjectResolver) Project

func (r *ProjectResolver) Project(ctx context.Context) (*ProjectResolver, error)

func (*ProjectResolver) Resources

func (r *ProjectResolver) Resources(ctx context.Context) ([]*ResourceResolver, error)

func (*ProjectResolver) Stacks

func (r *ProjectResolver) Stacks(ctx context.Context) ([]*StackResolver, error)

type ProjectRow

type ProjectRow struct {
	ID          string  `db:"id"`
	DisplayName *string `db:"display_name"`
}

type QueryResolver

type QueryResolver = RootResolver

While queries, mutations, and subscriptions are accessed in disjoint query paths, this GraphQL library assumes that their names will not conflict and therefore all resolvers go on the same struct. We use the following aliases for clarity. See <https://github.com/graph-gophers/graphql-go/pull/182> for more details. Note that even if this were not required, it's still convenient to be able to access query methods from mutations and subscriptions.

func (*QueryResolver) AllClusters

func (r *QueryResolver) AllClusters(ctx context.Context) ([]*ClusterResolver, error)

func (*QueryResolver) AllProjects

func (r *QueryResolver) AllProjects(ctx context.Context) ([]*ProjectResolver, error)

func (*QueryResolver) AllResources

func (r *QueryResolver) AllResources(ctx context.Context) ([]*ResourceResolver, error)

func (*QueryResolver) AllStacks

func (r *QueryResolver) AllStacks(ctx context.Context) ([]*StackResolver, error)

func (*QueryResolver) AllTasks

func (r *QueryResolver) AllTasks(ctx context.Context) ([]*TaskResolver, error)

func (*QueryResolver) AllVaults

func (r *QueryResolver) AllVaults(ctx context.Context) ([]*VaultResolver, error)

func (*QueryResolver) AllWorkspaces

func (r *QueryResolver) AllWorkspaces(ctx context.Context) ([]*WorkspaceResolver, error)

func (*QueryResolver) ClusterByRef

func (r *QueryResolver) ClusterByRef(ctx context.Context, args struct {
	Ref string
}) (*ClusterResolver, error)

func (*QueryResolver) ComponentByID

func (r *QueryResolver) ComponentByID(ctx context.Context, args struct {
	ID string
}) (*ComponentResolver, error)

func (*QueryResolver) ComponentByRef

func (r *QueryResolver) ComponentByRef(ctx context.Context, args struct {
	Ref   string
	Stack *string
}) (*ComponentResolver, error)

func (*QueryResolver) DefaultCluster

func (r *QueryResolver) DefaultCluster(ctx context.Context) (*ClusterResolver, error)

func (*QueryResolver) FindEntity

func (r *QueryResolver) FindEntity(ctx context.Context, args struct {
	Type string
	ID   string
}) (*Entity, error)

func (*QueryResolver) MakeManifest

func (r *QueryResolver) MakeManifest(ctx context.Context, args struct {
	Content string
	Format  *string
}) *ManifestResolver

func (*QueryResolver) Now

func (r *QueryResolver) Now(ctx context.Context) Instant

func (*QueryResolver) ProjectByID

func (r *QueryResolver) ProjectByID(ctx context.Context, args struct {
	ID string
}) (*ProjectResolver, error)

func (*QueryResolver) ResourceByID

func (r *QueryResolver) ResourceByID(ctx context.Context, args struct {
	ID string
}) (*ResourceResolver, error)

func (*QueryResolver) ResourceByIRI

func (r *QueryResolver) ResourceByIRI(ctx context.Context, args struct {
	IRI string
}) (*ResourceResolver, error)

func (*QueryResolver) ResourceByRef

func (r *QueryResolver) ResourceByRef(ctx context.Context, args struct {
	Ref string
}) (*ResourceResolver, error)

func (*QueryResolver) Routes

func (r *QueryResolver) Routes() *RoutesResolver

func (*QueryResolver) StackByID

func (r *QueryResolver) StackByID(ctx context.Context, args struct {
	ID string
}) (*StackResolver, error)

func (*QueryResolver) StackByRef

func (r *QueryResolver) StackByRef(ctx context.Context, args struct {
	Ref string
}) (*StackResolver, error)

func (*QueryResolver) TaskByID

func (r *QueryResolver) TaskByID(ctx context.Context, args struct {
	ID string
}) (*TaskResolver, error)

func (*QueryResolver) TasksByJobID

func (r *QueryResolver) TasksByJobID(ctx context.Context, args struct {
	JobID string
}) ([]*TaskResolver, error)

func (*QueryResolver) TasksByJobIDs

func (r *QueryResolver) TasksByJobIDs(ctx context.Context, args struct {
	JobIDs []string
}) ([]*TaskResolver, error)

func (*QueryResolver) VaultByID

func (r *QueryResolver) VaultByID(ctx context.Context, args struct {
	ID string
}) (*VaultResolver, error)

func (*QueryResolver) WorkspaceByID

func (r *QueryResolver) WorkspaceByID(ctx context.Context, args struct {
	ID string
}) (*WorkspaceResolver, error)

func (*QueryResolver) WorkspaceByRef

func (r *QueryResolver) WorkspaceByRef(ctx context.Context, args struct {
	Ref string
}) (*WorkspaceResolver, error)

type ReconciliationResolver

type ReconciliationResolver struct {
	Q         *RootResolver
	StackID   string
	Component *ComponentResolver
	Job       *JobResolver
}

func (*ReconciliationResolver) JobID

func (r *ReconciliationResolver) JobID() string

func (*ReconciliationResolver) Stack

type ResourceResolver

type ResourceResolver struct {
	Q *QueryResolver
	ResourceRow
}

func (*ResourceResolver) Component

func (r *ResourceResolver) Component(ctx context.Context) (*ComponentResolver, error)

func (*ResourceResolver) Model

func (r *ResourceResolver) Model() (obj JSONObject, err error)

func (*ResourceResolver) Operation

func (r *ResourceResolver) Operation(ctx context.Context) (*string, error)

func (*ResourceResolver) Owner

func (r *ResourceResolver) Owner(ctx context.Context) (any, error)

func (*ResourceResolver) OwnerType

func (r *ResourceResolver) OwnerType() *string

func (*ResourceResolver) Project

func (*ResourceResolver) Stack

func (*ResourceResolver) Task

type ResourceRow

type ResourceRow struct {
	ID          string  `db:"id"`
	Type        string  `db:"type"`
	IRI         *string `db:"iri"`
	ProjectID   *string `db:"project_id"`
	StackID     *string `db:"stack_id"`
	ComponentID *string `db:"component_id"`
	TaskID      *string `db:"task_id"`
	RawModel    RawJSON `db:"model"`
	Status      int32   `db:"status"`
	Message     *string `db:"message"`
}

type RootResolver

type RootResolver struct {
	SystemLog   logging.Logger
	VarDir      string
	GUIEndpoint string
	// Public interface of this RootResolver.
	Service api.Service
	// contains filtered or unexported fields
}

func (*RootResolver) AllTemplates

func (r *RootResolver) AllTemplates() []*TemplateResolver

func (*RootResolver) FileSystem

func (r *RootResolver) FileSystem() *FileSystemResolver

func (*RootResolver) Init

func (r *RootResolver) Init(ctx context.Context) error

func (*RootResolver) Shutdown

func (r *RootResolver) Shutdown(ctx context.Context) error

func (*RootResolver) System

func (r *RootResolver) System() *SystemResolver

func (*RootResolver) SystemChange

func (r *RootResolver) SystemChange(ctx context.Context) <-chan *SystemResolver

type RoutesResolver

type RoutesResolver struct {
	Root string
}

func (*RoutesResolver) JobURL

func (r *RoutesResolver) JobURL(args struct {
	ID string
}) string

func (*RoutesResolver) NewProjectURL

func (r *RoutesResolver) NewProjectURL(args struct {
	Workspace *string
}) string

func (*RoutesResolver) WorkspaceURL

func (r *RoutesResolver) WorkspaceURL(args struct {
	ID string
}) string

type SecretRecord

type SecretRecord struct {
	VaultID string
	Name    string
	Value   string
}

NOTE: Not a database row; avoiding secrets on disk.

type SecretResolver

type SecretResolver struct {
	Q *RootResolver
	SecretRecord
}

func (*SecretResolver) ValueIf

func (r *SecretResolver) ValueIf(ctx context.Context, args struct {
	Reveal bool
}) *string

func (*SecretResolver) Vault

func (r *SecretResolver) Vault(ctx context.Context) (*VaultResolver, error)

type StackResolver

type StackResolver struct {
	Q *QueryResolver
	StackRow
}

func (*StackResolver) Cluster

func (r *StackResolver) Cluster(ctx context.Context) (*ClusterResolver, error)

func (*StackResolver) Components

func (r *StackResolver) Components(ctx context.Context, args struct {
	All       *bool
	Recursive *bool
}) ([]*ComponentResolver, error)

func (*StackResolver) DisplayName

func (r *StackResolver) DisplayName() string

func (*StackResolver) Environment

func (r *StackResolver) Environment(ctx context.Context) (*EnvironmentResolver, error)

func (*StackResolver) Networks

func (*StackResolver) Processes

func (*StackResolver) Project

func (r *StackResolver) Project(ctx context.Context) (*ProjectResolver, error)

func (*StackResolver) Resources

func (r *StackResolver) Resources(ctx context.Context) ([]*ResourceResolver, error)

func (*StackResolver) Secrets

func (r *StackResolver) Secrets(ctx context.Context) ([]*SecretResolver, error)

func (*StackResolver) Stores

func (*StackResolver) Vaults

func (r *StackResolver) Vaults(ctx context.Context) ([]*VaultResolver, error)

func (*StackResolver) Workspace

func (r *StackResolver) Workspace(ctx context.Context) (*WorkspaceResolver, error)

type StackRow

type StackRow struct {
	ID                   string     `db:"id"`
	Name                 string     `db:"name"`
	ClusterID            string     `db:"cluster_id"`
	ProjectID            *string    `db:"project_id"`
	WorkspaceID          *string    `db:"workspace_id"`
	EnvironmentVariables JSONObject `db:"environment_variables"`
	Disposed             *Instant   `db:"disposed"`
}

type StackVaultRow

type StackVaultRow struct {
	StackID string `db:"stack_id"`
	VaultID string `db:"vault_id"`
}

type StoreComponentResolver

type StoreComponentResolver struct {
	StoreResolver

	ComponentID string
	Name        string
}

func (*StoreComponentResolver) Component

type StoreResolver

type StoreResolver struct {
	Q    *RootResolver
	Type string
}

func (*StoreResolver) SizeMiB

func (r *StoreResolver) SizeMiB() *float64

type StreamResolver

type StreamResolver struct {
	Q          *RootResolver
	SourceType string `db:"source_type"`
	SourceID   string `db:"source_id"`
}

func (*StreamResolver) Events

func (r *StreamResolver) Events(ctx context.Context, args struct {
	Cursor    *ULID
	Prev      *int32
	Next      *int32
	IContains *string
}) (*EventPageResolver, error)

func (*StreamResolver) Message

func (r *StreamResolver) Message(ctx context.Context) (string, error)

func (*StreamResolver) Source

func (r *StreamResolver) Source(ctx context.Context) (source StreamSourceResolver, err error)

type StreamSourceResolver

type StreamSourceResolver interface {
	Stream() *StreamResolver
	// contains filtered or unexported methods
}

type SubscriptionResolver

type SubscriptionResolver = RootResolver

func (*SubscriptionResolver) WatchJob

func (r *SubscriptionResolver) WatchJob(ctx context.Context, args struct {
	ID    string
	After *ULID
	Debug *bool
}) (<-chan *EventResolver, error)

type SystemResolver

type SystemResolver struct {
	Q *RootResolver
}

func (*SystemResolver) Stream

func (r *SystemResolver) Stream() *StreamResolver

func (*SystemResolver) Version

func (r *SystemResolver) Version() *VersionInfoResolver

type TaskInput

type TaskInput struct {
	Mutation  string
	Arguments map[string]any
}

type TaskResolver

type TaskResolver struct {
	Q *RootResolver
	TaskRow
}

func (*TaskResolver) Children

func (r *TaskResolver) Children(ctx context.Context) ([]*TaskResolver, error)

func (*TaskResolver) Job

func (r *TaskResolver) Job() *JobResolver

func (*TaskResolver) Label

func (r *TaskResolver) Label(ctx context.Context) (string, error)

func (*TaskResolver) Message

func (r *TaskResolver) Message(ctx context.Context) (string, error)

func (*TaskResolver) Parent

func (r *TaskResolver) Parent(ctx context.Context) (*TaskResolver, error)

func (*TaskResolver) Progress

func (r *TaskResolver) Progress() (*ProgressResolver, error)

func (*TaskResolver) Stream

func (r *TaskResolver) Stream() *StreamResolver

func (*TaskResolver) Successful

func (r *TaskResolver) Successful() (*bool, error)

type TaskRow

type TaskRow struct {
	ID              string     `db:"id"`
	JobID           string     `db:"job_id"`
	ParentID        *string    `db:"parent_id"`
	Mutation        string     `db:"mutation"`
	Arguments       JSONObject `db:"arguments"`
	Key             *string    `db:"key"`
	WorkerID        *string    `db:"worker_id"`
	Created         Instant    `db:"created"`
	Updated         Instant    `db:"updated"`
	Started         *Instant   `db:"started"`
	Canceled        *Instant   `db:"canceled"`
	Finished        *Instant   `db:"finished"`
	Completed       *Instant   `db:"completed"`
	ProgressCurrent int32      `db:"progress_current"`
	ProgressTotal   int32      `db:"progress_total"`
	Error           *string    `db:"error"`
}

type TemplateResolver

type TemplateResolver struct {
	Q *RootResolver
	template.TemplateDescription
}

type VaultResolver

type VaultResolver struct {
	Q *RootResolver
	VaultRow
}

func (*VaultResolver) Authenticated

func (r *VaultResolver) Authenticated() bool

func (*VaultResolver) Connected

func (r *VaultResolver) Connected() bool

func (*VaultResolver) Error

func (r *VaultResolver) Error() *string

func (*VaultResolver) Name

func (r *VaultResolver) Name() string

func (*VaultResolver) Secrets

func (r *VaultResolver) Secrets(ctx context.Context) ([]*SecretResolver, error)

type VaultRow

type VaultRow struct {
	ID      string `db:"id"`
	StackID string `db:"stack_id"`
	URL     string `db:"url"`
}

type VersionInfoResolver

type VersionInfoResolver struct {
	Installed string
	Build     string
	Managed   bool
}

func (*VersionInfoResolver) Latest

func (r *VersionInfoResolver) Latest(ctx context.Context) (string, error)

func (*VersionInfoResolver) Upgrade

func (r *VersionInfoResolver) Upgrade(ctx context.Context) *string

type VoidResolver

type VoidResolver struct {
	// See note: [EMPTY_GRAPHQL_TYPE].
	Void *VoidResolver
}
var Void *VoidResolver = nil

type WorkspaceResolver

type WorkspaceResolver struct {
	Q *QueryResolver
	WorkspaceRow
}

func (*WorkspaceResolver) Components

func (r *WorkspaceResolver) Components(ctx context.Context, args struct {
	All       *bool
	Recursive *bool
}) ([]*ComponentResolver, error)

func (*WorkspaceResolver) DisplayName

func (r *WorkspaceResolver) DisplayName(ctx context.Context) (string, error)

func (*WorkspaceResolver) Environment

func (r *WorkspaceResolver) Environment(ctx context.Context) (*EnvironmentResolver, error)

func (*WorkspaceResolver) FileSystem

func (r *WorkspaceResolver) FileSystem() *FileSystemResolver

func (*WorkspaceResolver) FindManifest

func (r *WorkspaceResolver) FindManifest(ctx context.Context, args struct {
	Format *string
}) (*ManifestResolver, error)

func (*WorkspaceResolver) Manifest

func (*WorkspaceResolver) Project

func (*WorkspaceResolver) Resources

func (r *WorkspaceResolver) Resources(ctx context.Context) ([]*ResourceResolver, error)

func (*WorkspaceResolver) Stack

func (*WorkspaceResolver) StackID

func (r *WorkspaceResolver) StackID(ctx context.Context) (*string, error)

func (*WorkspaceResolver) URL

func (r *WorkspaceResolver) URL() string

type WorkspaceRow

type WorkspaceRow struct {
	ID        string `db:"id"`
	Root      string `db:"root"`
	ProjectID string `db:"project_id"`
}

Jump to

Keyboard shortcuts

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