onboardcloud

package
v0.1.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run() error

Types

type BaseStep

type BaseStep struct{}

func (BaseStep) Apply

func (BaseStep) Apply(*Model, string)

func (BaseStep) Clear

func (BaseStep) Clear(*Model)

func (BaseStep) Execute

func (BaseStep) Execute(*Model) tea.Cmd

func (BaseStep) Help

func (BaseStep) Help(*Model) string

func (BaseStep) ShouldAutoProcess

func (BaseStep) ShouldAutoProcess(*Model) bool

func (BaseStep) ShouldSkip

func (BaseStep) ShouldSkip(*Model) bool

func (BaseStep) SkipReason

func (BaseStep) SkipReason(*Model) string

func (BaseStep) Validate

func (BaseStep) Validate(*Model, string) error

type ClientInfo

type ClientInfo struct {
	ID                   string
	Name                 string
	CodeHostingResources []CodeHostingResource
}

type CodeHostingResource

type CodeHostingResource struct {
	ID         int64
	Type       string // "github" or "gitlab"
	ExternalID string
}

type CodeHostingResourceType

type CodeHostingResourceType int
const (
	CodeHostingResourceTypeGitHub CodeHostingResourceType = iota
	CodeHostingResourceTypeGitLab
)

type ConfigUpdater

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

ConfigUpdater allows callbacks to specify which fields to update in the YAML

func (*ConfigUpdater) Set

func (u *ConfigUpdater) Set(path []string, value any)

Set registers a field to be updated in the YAML file

type CreateApiKeyStep

type CreateApiKeyStep struct{ BaseStep }

func (CreateApiKeyStep) Apply

func (CreateApiKeyStep) Apply(m *Model, input string)

func (CreateApiKeyStep) Clear

func (CreateApiKeyStep) Clear(m *Model)

func (CreateApiKeyStep) Default

func (CreateApiKeyStep) Default(*Model) string

func (CreateApiKeyStep) Description

func (CreateApiKeyStep) Description(m *Model) string

func (CreateApiKeyStep) Execute

func (CreateApiKeyStep) Execute(m *Model) tea.Cmd

func (CreateApiKeyStep) Heading

func (CreateApiKeyStep) Heading(*Model) string

func (CreateApiKeyStep) Help

func (CreateApiKeyStep) Help(m *Model) string

func (CreateApiKeyStep) ID

func (CreateApiKeyStep) ID() onboardStep

func (CreateApiKeyStep) InputIndex

func (CreateApiKeyStep) InputIndex() int

func (CreateApiKeyStep) ShouldAutoProcess

func (CreateApiKeyStep) ShouldAutoProcess(m *Model) bool

func (CreateApiKeyStep) ShouldSkip

func (CreateApiKeyStep) ShouldSkip(m *Model) bool

func (CreateApiKeyStep) SkipReason

func (CreateApiKeyStep) SkipReason(m *Model) string

func (CreateApiKeyStep) Validate

func (CreateApiKeyStep) Validate(m *Model, input string) error

type CreateObservableServiceStep

type CreateObservableServiceStep struct{ BaseStep }

func (CreateObservableServiceStep) Clear

func (CreateObservableServiceStep) Default

func (CreateObservableServiceStep) Description

func (CreateObservableServiceStep) Description(m *Model) string

func (CreateObservableServiceStep) Execute

func (CreateObservableServiceStep) Heading

func (CreateObservableServiceStep) Help

func (CreateObservableServiceStep) ID

func (CreateObservableServiceStep) ID() onboardStep

func (CreateObservableServiceStep) InputIndex

func (CreateObservableServiceStep) InputIndex() int

func (CreateObservableServiceStep) ShouldAutoProcess

func (CreateObservableServiceStep) ShouldAutoProcess(m *Model) bool

func (CreateObservableServiceStep) ShouldSkip

func (CreateObservableServiceStep) ShouldSkip(m *Model) bool

func (CreateObservableServiceStep) SkipReason

func (CreateObservableServiceStep) SkipReason(m *Model) string

type DoneStep

type DoneStep struct{ BaseStep }

func (DoneStep) Default

func (DoneStep) Default(*Model) string

func (DoneStep) Description

func (DoneStep) Description(*Model) string

func (DoneStep) Heading

func (DoneStep) Heading(*Model) string

func (DoneStep) ID

func (DoneStep) ID() onboardStep

func (DoneStep) InputIndex

func (DoneStep) InputIndex() int

type Flow

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

func NewFlow

func NewFlow(steps []Step) *Flow

func (*Flow) Current

func (f *Flow) Current(i int) Step

func (*Flow) NextIndex

func (f *Flow) NextIndex(i int, m *Model) int

func (*Flow) PrevIndex

func (f *Flow) PrevIndex(history []int) (int, []int, bool)

type IntroStep

type IntroStep struct{ BaseStep }

func (IntroStep) Default

func (IntroStep) Default(*Model) string

func (IntroStep) Description

func (IntroStep) Description(*Model) string

func (IntroStep) Heading

func (IntroStep) Heading(*Model) string

func (IntroStep) ID

func (IntroStep) ID() onboardStep

func (IntroStep) InputIndex

func (IntroStep) InputIndex() int

type Model

type Model struct {

	// State - Authentication
	IsLoggedIn       bool
	BearerToken      string
	UserId           string
	UserEmail        string
	HasApiKey        bool
	SelectedClient   *ClientInfo
	AvailableClients []ClientInfo

	// State - Git & Repo
	GitRepoOwner            string
	GitRepoName             string
	CodeHostingResourceType CodeHostingResourceType
	NeedsCodeHostingAuth    bool
	RepoAccessVerified      bool
	RepoID                  int64

	// State - Observable Service
	ServiceID      string
	ServiceCreated bool

	// State - API Key
	ApiKeyName         string
	ApiKey             string
	ApiKeyID           string
	CreateApiKeyChoice bool

	// State - Recording Config
	SamplingRate          string
	ExportSpans           bool
	EnableEnvVarRecording bool
	RecordingConfigTable  *RecordingConfigTable

	// State - CI Workflow
	CreateWorkflowFile bool
	WorkflowCreated    bool

	// Errors
	Err           error
	ValidationErr error
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type RecordingConfigStep

type RecordingConfigStep struct{ BaseStep }

func (RecordingConfigStep) Clear

func (RecordingConfigStep) Clear(m *Model)

func (RecordingConfigStep) Default

func (RecordingConfigStep) Default(m *Model) string

func (RecordingConfigStep) Description

func (RecordingConfigStep) Description(m *Model) string

func (RecordingConfigStep) Heading

func (RecordingConfigStep) Heading(*Model) string

func (RecordingConfigStep) Help

func (RecordingConfigStep) Help(m *Model) string

func (RecordingConfigStep) ID

func (RecordingConfigStep) ID() onboardStep

func (RecordingConfigStep) InputIndex

func (RecordingConfigStep) InputIndex() int

type RecordingConfigTable

type RecordingConfigTable struct {
	EditMode bool // For editing sampling rate
	// contains filtered or unexported fields
}

func NewRecordingConfigTable

func NewRecordingConfigTable(samplingRate string, exportSpans, enableEnvVarRecording bool) *RecordingConfigTable

func (*RecordingConfigTable) GetValues

func (rct *RecordingConfigTable) GetValues() (samplingRate float64, exportSpans, enableEnvVarRecording bool)

func (*RecordingConfigTable) SetFocused

func (rct *RecordingConfigTable) SetFocused(focused bool)

func (*RecordingConfigTable) Update

func (rct *RecordingConfigTable) Update(msg tea.Msg) (*RecordingConfigTable, tea.Cmd)

func (*RecordingConfigTable) View

func (rct *RecordingConfigTable) View() string

type ReviewStep

type ReviewStep struct{ BaseStep }

func (ReviewStep) Apply

func (ReviewStep) Apply(*Model, string)

func (ReviewStep) Clear

func (ReviewStep) Clear(*Model)

func (ReviewStep) Default

func (ReviewStep) Default(*Model) string

func (ReviewStep) Description

func (ReviewStep) Description(m *Model) string

func (ReviewStep) Execute

func (ReviewStep) Execute(*Model) tea.Cmd

func (ReviewStep) Heading

func (ReviewStep) Heading(*Model) string

func (ReviewStep) Help

func (ReviewStep) Help(*Model) string

func (ReviewStep) ID

func (ReviewStep) ID() onboardStep

func (ReviewStep) InputIndex

func (ReviewStep) InputIndex() int

func (ReviewStep) ShouldAutoProcess

func (ReviewStep) ShouldAutoProcess(*Model) bool

func (ReviewStep) ShouldSkip

func (ReviewStep) ShouldSkip(*Model) bool

func (ReviewStep) Validate

func (ReviewStep) Validate(*Model, string) error

type SelectClientStep

type SelectClientStep struct{ BaseStep }

func (SelectClientStep) Apply

func (SelectClientStep) Apply(m *Model, input string)

func (SelectClientStep) Default

func (SelectClientStep) Default(*Model) string

func (SelectClientStep) Description

func (SelectClientStep) Description(m *Model) string

func (SelectClientStep) Heading

func (SelectClientStep) Heading(*Model) string

func (SelectClientStep) Help

func (SelectClientStep) Help(*Model) string

func (SelectClientStep) ID

func (SelectClientStep) ID() onboardStep

func (SelectClientStep) InputIndex

func (SelectClientStep) InputIndex() int

func (SelectClientStep) ShouldSkip

func (SelectClientStep) ShouldSkip(m *Model) bool

func (SelectClientStep) Validate

func (SelectClientStep) Validate(m *Model, input string) error

type Step

type Step interface {
	ID() onboardStep
	InputIndex() int               // Index of the input field (0-based) for this step, -1 if no input is required
	Heading(*Model) string         // Heading for the step
	Description(*Model) string     // Additional information displayed below the question
	Default(*Model) string         // Default input value (empty string if not applicable)
	Validate(*Model, string) error // User input validation (returns nil if valid, error if invalid)
	Apply(*Model, string)          // Updates the model with the accepted user input. Called after validation succeeds.
	Help(*Model) string            // Help text displayed in the footer for the current step
	ShouldSkip(*Model) bool        // Whether the step should be skipped (based on current state)
	SkipReason(*Model) string      // Why the step was skipped (for display in summary)
	ShouldAutoProcess(*Model) bool // Whether to auto-process when landing on step
	Execute(*Model) tea.Cmd        // Custom execution logic (API calls, git detection, etc.)
	Clear(*Model)                  // Clears the current step's state
}

type ValidateConfigStep

type ValidateConfigStep struct{ BaseStep }

func (ValidateConfigStep) Apply

func (ValidateConfigStep) Apply(m *Model, input string)

func (ValidateConfigStep) Default

func (ValidateConfigStep) Default(*Model) string

func (ValidateConfigStep) Description

func (ValidateConfigStep) Description(m *Model) string

func (ValidateConfigStep) Heading

func (ValidateConfigStep) Heading(*Model) string

func (ValidateConfigStep) ID

func (ValidateConfigStep) ID() onboardStep

func (ValidateConfigStep) InputIndex

func (ValidateConfigStep) InputIndex() int

func (ValidateConfigStep) ShouldAutoProcess

func (ValidateConfigStep) ShouldAutoProcess(m *Model) bool

func (ValidateConfigStep) Validate

func (ValidateConfigStep) Validate(m *Model, input string) error

type VerifyGitRepoStep

type VerifyGitRepoStep struct{ BaseStep }

func (VerifyGitRepoStep) Default

func (VerifyGitRepoStep) Default(*Model) string

func (VerifyGitRepoStep) Description

func (VerifyGitRepoStep) Description(m *Model) string

func (VerifyGitRepoStep) Execute

func (VerifyGitRepoStep) Execute(m *Model) tea.Cmd

func (VerifyGitRepoStep) Heading

func (VerifyGitRepoStep) Heading(*Model) string

func (VerifyGitRepoStep) Help

func (VerifyGitRepoStep) Help(m *Model) string

func (VerifyGitRepoStep) ID

func (VerifyGitRepoStep) ID() onboardStep

func (VerifyGitRepoStep) InputIndex

func (VerifyGitRepoStep) InputIndex() int

func (VerifyGitRepoStep) ShouldAutoProcess

func (VerifyGitRepoStep) ShouldAutoProcess(m *Model) bool

type VerifyRepoAccessStep

type VerifyRepoAccessStep struct{ BaseStep }

func (VerifyRepoAccessStep) Clear

func (VerifyRepoAccessStep) Clear(m *Model)

func (VerifyRepoAccessStep) Default

func (VerifyRepoAccessStep) Default(*Model) string

func (VerifyRepoAccessStep) Description

func (VerifyRepoAccessStep) Description(m *Model) string

func (VerifyRepoAccessStep) Execute

func (VerifyRepoAccessStep) Execute(m *Model) tea.Cmd

func (VerifyRepoAccessStep) Heading

func (VerifyRepoAccessStep) Heading(*Model) string

func (VerifyRepoAccessStep) Help

func (VerifyRepoAccessStep) ID

func (VerifyRepoAccessStep) ID() onboardStep

func (VerifyRepoAccessStep) InputIndex

func (VerifyRepoAccessStep) InputIndex() int

func (VerifyRepoAccessStep) ShouldAutoProcess

func (VerifyRepoAccessStep) ShouldAutoProcess(m *Model) bool

Jump to

Keyboard shortcuts

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