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 DatabaseTestResult
- type Defaults
- 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 RawDockerDatabaseInput
- type RawOIDCInput
- type Server
- type ServerOptions
- 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) PrepareDatabase(ctx context.Context, raw RawDatabaseSourceInput) (PreparedDatabase, error)
- func (s *Service) TestDatabase(ctx context.Context, raw RawDatabaseInput) (DatabaseTestResult, 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"`
AuthModes []AuthModeOption `json:"auth_modes"`
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 DatabaseTestResult ¶
type DatabaseTestResult struct {
Message string `json:"message"`
}
type Defaults ¶
type Defaults struct {
ManualDatabase RawDatabaseInput `json:"manual_database"`
DockerDatabase RawDockerDatabaseInput `json:"docker_database"`
Auth RawAuthInput `json:"auth"`
}
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
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 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 Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ServerOptions) *Server
type ServerOptions ¶
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) PrepareDatabase ¶
func (s *Service) PrepareDatabase(ctx context.Context, raw RawDatabaseSourceInput) (PreparedDatabase, error)
func (*Service) TestDatabase ¶
func (s *Service) TestDatabase(ctx context.Context, raw RawDatabaseInput) (DatabaseTestResult, error)
Click to show internal directories.
Click to hide internal directories.