Documentation
¶
Index ¶
- Constants
- Variables
- type AgentOption
- type AuthConfig
- type AuthModeOption
- type AuthModeType
- type Bootstrap
- type CLIDiagnostic
- type CompleteRequest
- type CompleteResult
- type DatabaseConfig
- type DatabaseConnector
- type DatabaseSourceConfig
- type DatabaseSourceOption
- type DatabaseSourceType
- type Defaults
- type DesktopApplyResult
- type DesktopIssue
- type DesktopIssueCode
- type DesktopPreflightResult
- type DockerDatabaseConfig
- type DockerDatabaseRuntime
- type DockerRunner
- type InstallInput
- type Installer
- type OIDCConfig
- type Options
- type OrganizationConfig
- type PreparedDatabase
- type ProjectConfig
- type RawAuthInput
- type RawCompleteRequest
- type RawDatabaseInput
- type RawDatabaseSourceInput
- type RawDesktopApplyRequest
- type RawDockerDatabaseInput
- type RawOIDCInput
- type Service
- func (s *Service) Bootstrap(ctx context.Context) (Bootstrap, error)
- func (s *Service) Complete(ctx context.Context, raw RawCompleteRequest) (CompleteResult, error)
- func (s *Service) DesktopApply(ctx context.Context, raw RawDesktopApplyRequest) (DesktopApplyResult, error)
- func (s *Service) DesktopPreflight(ctx context.Context) (DesktopPreflightResult, error)
- func (s *Service) PrepareDatabase(ctx context.Context, raw RawDatabaseSourceInput) (PreparedDatabase, error)
Constants ¶
View Source
const ( DefaultOrganizationName = "Local Workspace" DefaultOrganizationSlug = "local-workspace" DefaultProjectName = "OpenASE Workspace" DefaultProjectSlug = "openase-workspace" DefaultOIDCRedirectURL = "http://127.0.0.1:19836/api/v1" + "/auth/oidc/callback" DefaultOIDCScopes = "openid,profile,email,groups" DefaultOIDCSessionTTL = "8h" DefaultOIDCIdleTTL = "30m" )
Variables ¶
View Source
var ErrSetupAlreadyCompleted = errors.New("setup already completed")
Functions ¶
This section is empty.
Types ¶
type AgentOption ¶
type AgentOption struct {
ID string `json:"id"`
Name string `json:"name"`
Command string `json:"command"`
AdapterType catalogdomain.AgentProviderAdapterType `json:"adapter_type"`
ModelName string `json:"model_name"`
Available bool `json:"available"`
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
}
type AuthConfig ¶
type AuthConfig struct {
Mode AuthModeType
OIDC *OIDCConfig
}
func ParseAuthInput ¶
func ParseAuthInput(raw RawAuthInput) (AuthConfig, error)
func (AuthConfig) Raw ¶
func (c AuthConfig) Raw() RawAuthInput
type AuthModeOption ¶
type AuthModeOption struct {
ID AuthModeType `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
type AuthModeType ¶
type AuthModeType string
const ( AuthModeDisabled AuthModeType = "disabled" AuthModeOIDC AuthModeType = "oidc" )
type Bootstrap ¶
type Bootstrap struct {
ConfigExists bool `json:"config_exists"`
ConfigPath string `json:"config_path"`
Sources []DatabaseSourceOption `json:"sources"`
Agents []AgentOption `json:"agents"`
CLI []CLIDiagnostic `json:"cli"`
Defaults Defaults `json:"defaults"`
}
type CLIDiagnostic ¶
type CompleteRequest ¶
type CompleteRequest struct {
Database DatabaseConfig
Auth AuthConfig
AllowOverwrite bool
}
type CompleteResult ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Host string
Port int
Name string
User string
Password string
SSLMode string
}
func (DatabaseConfig) DSN ¶
func (c DatabaseConfig) DSN() string
func (DatabaseConfig) Raw ¶
func (c DatabaseConfig) Raw() RawDatabaseInput
type DatabaseConnector ¶
type DatabaseSourceConfig ¶
type DatabaseSourceConfig struct {
Type DatabaseSourceType
Manual *DatabaseConfig
Docker *DockerDatabaseConfig
}
type DatabaseSourceOption ¶
type DatabaseSourceOption struct {
ID DatabaseSourceType `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
type DatabaseSourceType ¶
type DatabaseSourceType string
const ( DatabaseSourceManual DatabaseSourceType = "manual" DatabaseSourceDocker DatabaseSourceType = "docker" )
type Defaults ¶
type Defaults struct {
ManualDatabase RawDatabaseInput `json:"manual_database"`
DockerDatabase RawDockerDatabaseInput `json:"docker_database"`
}
type DesktopApplyResult ¶ added in v0.3.0
type DesktopApplyResult struct {
Ready bool `json:"ready"`
ConfigPath string `json:"config_path"`
EnvPath string `json:"env_path,omitempty"`
OpenASEHomeDir string `json:"openase_home_dir"`
DatabaseSource DatabaseSourceType `json:"database_source,omitempty"`
Docker *DockerDatabaseRuntime `json:"docker,omitempty"`
Issues []DesktopIssue `json:"issues,omitempty"`
}
type DesktopIssue ¶ added in v0.3.0
type DesktopIssue struct {
Code DesktopIssueCode `json:"code"`
Title string `json:"title"`
Message string `json:"message"`
Action string `json:"action,omitempty"`
}
type DesktopIssueCode ¶ added in v0.3.0
type DesktopIssueCode string
const ( DesktopIssueConfigMissing DesktopIssueCode = "config_missing" DesktopIssueConfigInvalid DesktopIssueCode = "config_invalid" DesktopIssueDatabaseAuthFailed DesktopIssueCode = "database_auth_failed" DesktopIssueDatabaseUnreachable DesktopIssueCode = "database_unreachable" DesktopIssuePortConflict DesktopIssueCode = "port_conflict" DesktopIssueSetupTimeout DesktopIssueCode = "setup_timeout" DesktopIssueInputInvalid DesktopIssueCode = "input_invalid" DesktopIssueSetupFailed DesktopIssueCode = "setup_failed" )
type DesktopPreflightResult ¶ added in v0.3.0
type DesktopPreflightResult struct {
Ready bool `json:"ready"`
ConfigPath string `json:"config_path"`
OpenASEHomeDir string `json:"openase_home_dir"`
Issues []DesktopIssue `json:"issues,omitempty"`
}
type DockerDatabaseConfig ¶
type DockerDatabaseRuntime ¶
type DockerRunner ¶
type InstallInput ¶
type InstallInput struct {
Database DatabaseConfig
Agents []AgentOption
Organization OrganizationConfig
Project ProjectConfig
}
type OIDCConfig ¶
type Options ¶
type Options struct {
HomeDir string
ConfigPath string
Resolver provider.ExecutableResolver
Connector DatabaseConnector
Installer Installer
DockerRunner DockerRunner
RunCommand func(context.Context, string, ...string) (string, error)
}
type OrganizationConfig ¶
type PreparedDatabase ¶
type PreparedDatabase struct {
Source DatabaseSourceType
Config DatabaseConfig
Docker *DockerDatabaseRuntime
}
type ProjectConfig ¶
type RawAuthInput ¶
type RawAuthInput struct {
Mode string `json:"mode"`
OIDC *RawOIDCInput `json:"oidc,omitempty"`
}
type RawCompleteRequest ¶
type RawCompleteRequest struct {
Database RawDatabaseInput `json:"database"`
Auth RawAuthInput `json:"auth"`
AllowOverwrite bool `json:"allow_overwrite,omitempty"`
}
type RawDatabaseInput ¶
type RawDatabaseSourceInput ¶
type RawDatabaseSourceInput struct {
Type string `json:"type"`
Manual *RawDatabaseInput `json:"manual,omitempty"`
Docker *RawDockerDatabaseInput `json:"docker,omitempty"`
}
type RawDesktopApplyRequest ¶ added in v0.3.0
type RawDesktopApplyRequest struct {
Database RawDatabaseSourceInput `json:"database"`
AllowOverwrite bool `json:"allow_overwrite,omitempty"`
}
type RawDockerDatabaseInput ¶
type RawOIDCInput ¶
type RawOIDCInput struct {
IssuerURL string `json:"issuer_url"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
RedirectURL string `json:"redirect_url"`
Scopes string `json:"scopes"`
AllowedEmailDomains string `json:"allowed_email_domains,omitempty"`
BootstrapAdminEmails string `json:"bootstrap_admin_emails,omitempty"`
SessionTTL string `json:"session_ttl,omitempty"`
SessionIdleTTL string `json:"session_idle_ttl,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Complete ¶
func (s *Service) Complete(ctx context.Context, raw RawCompleteRequest) (CompleteResult, error)
func (*Service) DesktopApply ¶ added in v0.3.0
func (s *Service) DesktopApply(ctx context.Context, raw RawDesktopApplyRequest) (DesktopApplyResult, error)
func (*Service) DesktopPreflight ¶ added in v0.3.0
func (s *Service) DesktopPreflight(ctx context.Context) (DesktopPreflightResult, error)
func (*Service) PrepareDatabase ¶
func (s *Service) PrepareDatabase(ctx context.Context, raw RawDatabaseSourceInput) (PreparedDatabase, error)
Click to show internal directories.
Click to hide internal directories.