project

package
v0.1.111 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildFailed = fmt.Errorf("")
View Source
var ErrConfigExists = fmt.Errorf("sst.config.ts already exists")
View Source
var ErrInvalidAppName = fmt.Errorf("invalid app name")
View Source
var ErrInvalidStageName = fmt.Errorf("invalid stage name")
View Source
var ErrPackageJsonInvalid = fmt.Errorf("package.json is invalid")
View Source
var ErrPassphraseInvalid = fmt.Errorf("passphrase invalid")
View Source
var ErrStackRunFailed = fmt.Errorf("stack run had errors")
View Source
var ErrStageNotFound = fmt.Errorf("stage not found")
View Source
var ErrV2Config = fmt.Errorf("sstv2 config detected")
View Source
var ErrVersionInvalid = fmt.Errorf("invalid version")
View Source
var ErrVersionMismatch = fmt.Errorf("")
View Source
var InvalidAppRegex = regexp.MustCompile(`[^a-zA-Z0-9-]`)
View Source
var InvalidStageRegex = regexp.MustCompile(`[^a-zA-Z0-9-]`)

Functions

func Create

func Create(templateName string, home string) ([]string, error)

func Discover

func Discover() (string, error)

func LoadPersonalStage

func LoadPersonalStage(cfgPath string) string

func ResolvePlatformDir

func ResolvePlatformDir(cfgPath string) string

func ResolveWorkingDir

func ResolveWorkingDir(cfgPath string) string

func SetPersonalStage

func SetPersonalStage(cfgPath string, stage string) error

Types

type App

type App struct {
	Name      string                 `json:"name"`
	Stage     string                 `json:"stage"`
	Removal   string                 `json:"removal"`
	Providers map[string]interface{} `json:"providers"`
	Home      string                 `json:"home"`
	Version   string                 `json:"version"`
	// Deprecated: Backend is now Home
	Backend string `json:"backend"`
	// Deprecated: RemovalPolicy is now Removal
	RemovalPolicy string `json:"removalPolicy"`
}

type AwsReceiver added in v0.0.319

type AwsReceiver struct {
	Role string `json:"role"`
}

type BuildFailedEvent added in v0.0.293

type BuildFailedEvent struct {
	Error string
}

type BuildSuccessEvent added in v0.1.95

type BuildSuccessEvent struct {
	Files []string
}

type CloudflareReceiver added in v0.0.319

type CloudflareReceiver struct {
}

type CompleteEvent

type CompleteEvent struct {
	Links       Links
	Warps       Warps
	Receivers   Receivers
	Devs        Devs
	Outputs     map[string]interface{}
	Hints       map[string]string
	Versions    map[string]int
	Errors      []Error
	Finished    bool
	Old         bool
	Resources   []apitype.ResourceV3
	ImportDiffs map[string][]ImportDiff
}

type ConcurrentUpdateEvent

type ConcurrentUpdateEvent struct{}

type Dev added in v0.0.487

type Dev struct {
	Name        string            `json:"name"`
	Command     string            `json:"command"`
	Directory   string            `json:"directory"`
	Autostart   bool              `json:"autostart"`
	Links       []string          `json:"links"`
	Environment map[string]string `json:"environment"`
	Aws         *struct {
		Role string `json:"role"`
	} `json:"aws"`
}

type Devs added in v0.0.487

type Devs map[string]Dev

type Error

type Error struct {
	Message string `json:"message"`
	URN     string `json:"urn"`
}

type ImportDiff added in v0.1.3

type ImportDiff struct {
	URN   string
	Input string
	Old   interface{}
	New   interface{}
}

type ImportOptions

type ImportOptions struct {
	Type   string
	Name   string
	ID     string
	Parent string
}
type Links map[string]interface{}

type PackageJson

type PackageJson struct {
	Version      string                 `json:"version"`
	Dependencies map[string]string      `json:"dependencies"`
	Other        map[string]interface{} `json:"-"`
}

type PreviewInput added in v0.1.15

type PreviewInput struct {
	Out chan interface{}
}

type Project

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

func New

func New(input *ProjectConfig) (*Project, error)

func (*Project) Add

func (p *Project) Add(pkg string) error

func (Project) App

func (p Project) App() *App

func (Project) Backend

func (p Project) Backend() provider.Home

func (*Project) Cancel added in v0.1.5

func (s *Project) Cancel() error

func (*Project) CheckPlatform

func (p *Project) CheckPlatform(version string) bool

func (*Project) Cleanup

func (p *Project) Cleanup() error

func (*Project) CopyPlatform

func (p *Project) CopyPlatform(version string) error

func (Project) Env added in v0.0.257

func (p Project) Env() map[string]string

func (*Project) EnvFor added in v0.1.71

func (p *Project) EnvFor(ctx context.Context, complete *CompleteEvent, name string) (map[string]string, error)

func (*Project) GetCompleted added in v0.1.71

func (p *Project) GetCompleted(ctx context.Context) (*CompleteEvent, error)

func (*Project) Install

func (p *Project) Install() error

func (*Project) LoadHome added in v0.0.219

func (proj *Project) LoadHome() error

func (*Project) Lock added in v0.1.5

func (s *Project) Lock(updateID string, command string) error

func (*Project) NeedsInstall

func (p *Project) NeedsInstall() bool

func (Project) PathConfig

func (p Project) PathConfig() string

func (*Project) PathLog added in v0.1.48

func (p *Project) PathLog(name string) string

func (Project) PathPlatformDir

func (p Project) PathPlatformDir() string

func (Project) PathRoot

func (p Project) PathRoot() string

func (Project) PathWorkingDir

func (p Project) PathWorkingDir() string

func (*Project) Provider added in v0.0.257

func (p *Project) Provider(name string) (provider.Provider, bool)

func (*Project) PullState added in v0.1.5

func (s *Project) PullState() (string, error)

func (*Project) PushState added in v0.1.5

func (s *Project) PushState(version string) error

func (*Project) Run added in v0.1.5

func (p *Project) Run(ctx context.Context, input *StackInput) error

func (*Project) Unlock added in v0.1.5

func (s *Project) Unlock() error

func (Project) Version

func (p Project) Version() string

type ProjectConfig

type ProjectConfig struct {
	Version string
	Stage   string
	Config  string
}

type ProviderDownloadEvent added in v0.1.48

type ProviderDownloadEvent struct {
	Name    string
	Version string
}

type ProviderLock added in v0.0.348

type ProviderLock = []*ProviderLockEntry

type ProviderLockEntry added in v0.0.348

type ProviderLockEntry struct {
	Name    string `json:"name"`
	Package string `json:"package"`
	Version string `json:"version"`
	Alias   string `json:"alias"`
}

type Receiver

type Receiver struct {
	Name        string              `json:"name"`
	Directory   string              `json:"directory"`
	Links       []string            `json:"links"`
	Environment map[string]string   `json:"environment"`
	AwsRole     string              `json:"awsRole"`
	Cloudflare  *CloudflareReceiver `json:"cloudflare"`
	Aws         *AwsReceiver        `json:"aws"`
}

type Receivers

type Receivers map[string]Receiver

type StackCommandEvent

type StackCommandEvent struct {
	App     string
	Stage   string
	Config  string
	Command string
	Version string
}

type StackInput

type StackInput struct {
	Command    string
	Target     []string
	ServerPort int
	Dev        bool
	Verbose    bool
}

type Warp

type Warp struct {
	FunctionID string          `json:"functionID"`
	Runtime    string          `json:"runtime"`
	Handler    string          `json:"handler"`
	Bundle     string          `json:"bundle"`
	Properties json.RawMessage `json:"properties"`
	Links      []string        `json:"links"`
	CopyFiles  []struct {
		From string `json:"from"`
		To   string `json:"to"`
	} `json:"copyFiles"`
	Environment map[string]string `json:"environment"`
}

type Warps

type Warps map[string]Warp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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