projects

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Project linting

We don't want to run a Python/NodeJS process on every call to lint, so we're using regular expression. This means we won't be right every time but close enough for now. Later we can think of running a lint/lsp server for these calls.

Index

Constants

This section is empty.

Variables

View Source
var Rules = map[string]string{
	"E1": "Project size too large",
	"E2": "Duplicate connection name",
	"E3": "Duplicate trigger name",
	"E4": "Bad `call` format",
	"E5": "File not found",
	"E6": "Syntax error",
	"E7": "Missing handler",
	"E8": "Nonexisting connection",
	"E9": "Malformed name",

	"W1": "Empty variable",
	"W2": "No triggers defined",
}

Functions

func New

func New(p Projects, telemetry *telemetry.Telemetry) sdkservices.Projects

func Validate added in v0.13.2

func Validate(projectID sdktypes.ProjectID, manifest *manifest.Manifest, resources map[string][]byte) []*sdktypes.CheckViolation

Types

type Checker added in v0.13.2

type Checker func(projectID sdktypes.ProjectID, manifest *manifest.Manifest, resources map[string][]byte) []*sdktypes.CheckViolation

type Projects

type Projects struct {
	fx.In

	Z            *zap.Logger
	DB           db.DB
	Builds       sdkservices.Builds
	Runtimes     sdkservices.Runtimes
	Integrations sdkservices.Integrations
}

func (*Projects) Build

func (ps *Projects) Build(ctx context.Context, projectID sdktypes.ProjectID) (sdktypes.BuildID, error)

func (*Projects) Create

func (ps *Projects) Create(ctx context.Context, project sdktypes.Project) (sdktypes.ProjectID, error)

func (*Projects) Delete added in v0.3.1

func (ps *Projects) Delete(ctx context.Context, pid sdktypes.ProjectID) error

func (*Projects) DownloadResources

func (ps *Projects) DownloadResources(ctx context.Context, projectID sdktypes.ProjectID) (map[string][]byte, error)

func (*Projects) Export added in v0.10.2

func (ps *Projects) Export(ctx context.Context, projectID sdktypes.ProjectID) ([]byte, error)

func (*Projects) GetByID

func (ps *Projects) GetByID(ctx context.Context, pid sdktypes.ProjectID) (sdktypes.Project, error)

func (*Projects) GetByName

func (ps *Projects) GetByName(ctx context.Context, oid sdktypes.OrgID, n sdktypes.Symbol) (sdktypes.Project, error)

func (*Projects) Lint added in v0.13.2

func (ps *Projects) Lint(ctx context.Context, projectID sdktypes.ProjectID, resources map[string][]byte, manifestFile string) ([]*sdktypes.CheckViolation, error)

func (*Projects) List

func (ps *Projects) List(ctx context.Context, oid sdktypes.OrgID) ([]sdktypes.Project, error)

func (*Projects) SetResources

func (ps *Projects) SetResources(ctx context.Context, projectID sdktypes.ProjectID, resources map[string][]byte) error

func (*Projects) Update

func (ps *Projects) Update(ctx context.Context, project sdktypes.Project) error

Jump to

Keyboard shortcuts

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