Documentation
¶
Index ¶
- Constants
- func CheckDependencies() tea.Cmd
- func Generate(dir string, schema *proto.Schema, nodePackagesPath string, output chan tea.Msg) tea.Cmd
- func GenerateClient(dir string, schema *proto.Schema, apiName string, outputDir string, ...) tea.Cmd
- func Init(dir string) tea.Cmd
- func LoadSchema(dir, environment string) tea.Cmd
- func LoadSecrets(path, environment string) (map[string]string, error)
- func NextMsgCommand(ch chan tea.Msg) tea.Cmd
- func ParsePrivateKey(path string) tea.Cmd
- func RemoveSecret(path, environment, key string) error
- func RenderError(message error) error
- func RenderSecrets(secrets map[string]string) string
- func RenderSuccess(message string)
- func Run(model *Model)
- func RunMigrations(schema *proto.Schema, database db.Database) tea.Cmd
- func RunTests(dir string, port string, cfg *config.ProjectConfig, conn *db.ConnectionInfo, ...) tea.Cmd
- func SetSecret(path, environment, key, value string) error
- func SetupFunctions(dir string, nodePackagesPath string) tea.Cmd
- func StartDatabase(reset bool, mode int, projectDirectory string) tea.Cmd
- func StartFunctions(m *Model) tea.Cmd
- func StartRuntimeServer(port string, ch chan tea.Msg) tea.Cmd
- func StartWatcher(dir string, ch chan tea.Msg) tea.Cmd
- func UpdateFunctions(schema *proto.Schema, dir string) tea.Cmd
- type ApplyMigrationsError
- type CheckDependenciesMsg
- type FunctionLog
- type FunctionsOutputMsg
- type FunctionsOutputWriter
- type GenerateClientModel
- type GenerateClientMsg
- type GenerateModel
- type GenerateMsg
- type InitModel
- type InitialisedMsg
- type LoadSchemaMsg
- type Model
- type ParsePrivateKeyMsg
- type RunMigrationsMsg
- type RunTestsMsg
- type RuntimeRequest
- type RuntimeRequestMsg
- type SetupFunctionsMsg
- type StartDatabaseMsg
- type StartFunctionsError
- type StartFunctionsMsg
- type TypeScriptError
- type UpdateFunctionsMsg
- type WatcherMsg
Constants ¶
View Source
const ( StatusCheckEligibility = iota StatusNotGenerated StatusBootstrapping StatusNpmInstalling StatusGeneratingNodePackages StatusScaffolding StatusGenerated )
These statuses are specific to the generate cmd The statuses are ordered by when they are executed.
View Source
const ( StatusInitializing = iota StatusInitialized )
View Source
const ( ModeValidate = iota ModeRun ModeTest )
View Source
const ( StatusCheckingDependencies = iota StatusParsePrivateKey StatusSetupDatabase StatusSetupFunctions StatusLoadSchema StatusRunMigrations StatusUpdateFunctions StatusStartingFunctions StatusRunning StatusQuitting )
View Source
const (
StatusGeneratingClient = iota
)
Variables ¶
This section is empty.
Functions ¶
func CheckDependencies ¶
func Generate ¶
func Generate(dir string, schema *proto.Schema, nodePackagesPath string, output chan tea.Msg) tea.Cmd
Generate takes care of ensuring that all of the required steps to get a working Keel project with functions are executed including: - package.json + tsconfig.json generated - Installing deps via npm - Generating dynamic sdk + testing packages - Scaffolding any missing custom functions
func GenerateClient ¶
func LoadSchema ¶
func LoadSecrets ¶
LoadSecrets lists secrets from the given file and returns a command
func ParsePrivateKey ¶
func RemoveSecret ¶
func RenderError ¶
func RenderSecrets ¶
func RenderSuccess ¶
func RenderSuccess(message string)
func RunTests ¶
func RunTests(dir string, port string, cfg *config.ProjectConfig, conn *db.ConnectionInfo, pattern string) tea.Cmd
func StartFunctions ¶
Types ¶
type ApplyMigrationsError ¶
type ApplyMigrationsError struct {
Err error
}
func (*ApplyMigrationsError) Error ¶
func (a *ApplyMigrationsError) Error() string
func (*ApplyMigrationsError) Unwrap ¶ added in v0.369.1
func (e *ApplyMigrationsError) Unwrap() error
type CheckDependenciesMsg ¶
type CheckDependenciesMsg struct {
Err error
}
type FunctionLog ¶
type FunctionsOutputMsg ¶
type FunctionsOutputMsg struct {
Output string
}
type FunctionsOutputWriter ¶
type GenerateClientModel ¶
type GenerateClientModel struct {
// The directory of the Keel project
ProjectDir string
Package bool
OutputDir string
ApiName string
Status int
Err error
Schema *proto.Schema
SchemaFiles []reader.SchemaFile
Secrets map[string]string
Config *config.ProjectConfig
GeneratedFiles codegen.GeneratedFiles
// contains filtered or unexported fields
}
func (*GenerateClientModel) Init ¶
func (m *GenerateClientModel) Init() tea.Cmd
func (*GenerateClientModel) View ¶
func (m *GenerateClientModel) View() string
type GenerateClientMsg ¶
type GenerateClientMsg struct {
Err error
Status int
GeneratedFiles codegen.GeneratedFiles
Log string
}
type GenerateModel ¶
type GenerateModel struct {
// The directory of the Keel project
ProjectDir string
// If set then @teamkeel/* npm packages will be installed
// from this path, rather than NPM.
NodePackagesPath string
Environment string
Status int
Err error
Schema *proto.Schema
SchemaFiles []reader.SchemaFile
Secrets map[string]string
Config *config.ProjectConfig
GeneratedFiles codegen.GeneratedFiles
// contains filtered or unexported fields
}
func (*GenerateModel) Init ¶
func (m *GenerateModel) Init() tea.Cmd
func (*GenerateModel) View ¶
func (m *GenerateModel) View() string
type GenerateMsg ¶
type GenerateMsg struct {
Err error
Status int
GeneratedFiles codegen.GeneratedFiles
Log string
}
type InitModel ¶
type InitModel struct {
// The directory of the Keel project
ProjectDir string
Err error
Status int
GeneratedFiles codegen.GeneratedFiles
// contains filtered or unexported fields
}
type InitialisedMsg ¶
type InitialisedMsg struct {
GeneratedFiles codegen.GeneratedFiles
Err error
}
type LoadSchemaMsg ¶
type LoadSchemaMsg struct {
Schema *proto.Schema
Config *config.ProjectConfig
SchemaFiles []reader.SchemaFile
Secrets map[string]string
Err error
}
type Model ¶
type Model struct {
// The directory of the Keel project
ProjectDir string
// The mode the Model is running in
Mode int
// Port to run the runtime server on in ModeRun
Port string
// If true then the database will be reset. Only
// applies to ModeRun.
ResetDatabase bool
// If set then @teamkeel/* npm packages will be installed
// from this path, rather than NPM.
NodePackagesPath string
// If set then runtime will be configured with private key
// located at this path in pem format.
PrivateKeyPath string
// The private key to configure on runtime, or nil.
PrivateKey *rsa.PrivateKey
// Pattern to pass to vitest to isolate specific tests
TestPattern string
// If true then an OTLP export will be setup for the runtime and the
// env var KEEL_TRACING_ENABLED will be passed to the functions runtime
TracingEnabled bool
// Model state - used in View()
Status int
Err error
Schema *proto.Schema
Config *config.ProjectConfig
SchemaFiles []reader.SchemaFile
Database db.Database
DatabaseConnInfo *db.ConnectionInfo
GeneratedFiles codegen.GeneratedFiles
MigrationChanges []*migrations.DatabaseChange
FunctionsServer *node.DevelopmentServer
RuntimeHandler http.Handler
JobHandler runtime.JobHandler
SubscriberHandler runtime.SubscriberHandler
RuntimeRequests []*RuntimeRequest
FunctionsLog []*FunctionLog
TestOutput string
Secrets map[string]string
Environment string
// contains filtered or unexported fields
}
type ParsePrivateKeyMsg ¶
type ParsePrivateKeyMsg struct {
PrivateKey *rsa.PrivateKey
Err error
}
type RunMigrationsMsg ¶
type RunMigrationsMsg struct {
Err error
Changes []*migrations.DatabaseChange
}
type RunTestsMsg ¶
type RuntimeRequestMsg ¶
type RuntimeRequestMsg struct {
// contains filtered or unexported fields
}
type SetupFunctionsMsg ¶
type SetupFunctionsMsg struct {
Err error
}
type StartDatabaseMsg ¶
type StartDatabaseMsg struct {
ConnInfo *db.ConnectionInfo
Err error
}
type StartFunctionsError ¶
func (*StartFunctionsError) Error ¶
func (s *StartFunctionsError) Error() string
type StartFunctionsMsg ¶
type StartFunctionsMsg struct {
Err error
Server *node.DevelopmentServer
}
type TypeScriptError ¶
func (*TypeScriptError) Error ¶
func (t *TypeScriptError) Error() string
type UpdateFunctionsMsg ¶
type UpdateFunctionsMsg struct {
Err error
}
type WatcherMsg ¶
Click to show internal directories.
Click to hide internal directories.