controllers

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIController added in v0.19.8

type APIController struct {
	APISecret                      []byte
	Locker                         locking.Locker                   `validate:"required"`
	Logger                         logging.SimpleLogging            `validate:"required"`
	Parser                         events.EventParsing              `validate:"required"`
	ProjectCommandBuilder          events.ProjectCommandBuilder     `validate:"required"`
	ProjectPlanCommandRunner       events.ProjectPlanCommandRunner  `validate:"required"`
	ProjectApplyCommandRunner      events.ProjectApplyCommandRunner `validate:"required"`
	FailOnPreWorkflowHookError     bool
	PreWorkflowHooksCommandRunner  events.PreWorkflowHooksCommandRunner  `validate:"required"`
	PostWorkflowHooksCommandRunner events.PostWorkflowHooksCommandRunner `validate:"required"`
	RepoAllowlistChecker           *events.RepoAllowlistChecker          `validate:"required"`
	Scope                          tally.Scope                           `validate:"required"`
	VCSClient                      vcs.Client                            `validate:"required"`
	WorkingDir                     events.WorkingDir                     `validate:"required"`
	WorkingDirLocker               events.WorkingDirLocker               `validate:"required"`
	CommitStatusUpdater            events.CommitStatusUpdater            `validate:"required"`
	// SilenceVCSStatusNoProjects is whether API should set commit status if no projects are found
	SilenceVCSStatusNoProjects bool
}

func (*APIController) Apply added in v0.19.8

func (a *APIController) Apply(w http.ResponseWriter, r *http.Request)

func (*APIController) ListLocks added in v0.34.0

func (a *APIController) ListLocks(w http.ResponseWriter, r *http.Request)

func (*APIController) Plan added in v0.19.8

func (a *APIController) Plan(w http.ResponseWriter, r *http.Request)

type APIRequest added in v0.19.8

type APIRequest struct {
	Repository string `validate:"required"`
	Ref        string `validate:"required"`
	Type       string `validate:"required"`
	PR         int
	Projects   []string
	Paths      []struct {
		Directory string
		Workspace string
	}
}

type GithubAppController

type GithubAppController struct {
	AtlantisURL         *url.URL              `validate:"required"`
	Logger              logging.SimpleLogging `validate:"required"`
	GithubSetupComplete bool
	GithubHostname      string `validate:"required"`
	GithubOrg           string
}

GithubAppController handles the creation and setup of a new GitHub app

func (*GithubAppController) ExchangeCode

func (g *GithubAppController) ExchangeCode(w http.ResponseWriter, r *http.Request)

ExchangeCode handles the user coming back from creating their app A code query parameter is exchanged for this app's ID, key, and webhook_secret Implements https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/#implementing-the-github-app-manifest-flow

func (*GithubAppController) New

New redirects the user to create a new GitHub app

type JobIDKeyGenerator added in v0.18.3

type JobIDKeyGenerator struct{}

func (JobIDKeyGenerator) Generate added in v0.18.3

func (g JobIDKeyGenerator) Generate(r *http.Request) (string, error)

type JobsController added in v0.18.0

type JobsController struct {
	AtlantisVersion          string                       `validate:"required"`
	AtlantisURL              *url.URL                     `validate:"required"`
	Logger                   logging.SimpleLogging        `validate:"required"`
	ProjectJobsTemplate      web_templates.TemplateWriter `validate:"required"`
	ProjectJobsErrorTemplate web_templates.TemplateWriter `validate:"required"`
	Database                 db.Database                  `validate:"required"`
	WsMux                    *websocket.Multiplexor       `validate:"required"`
	KeyGenerator             JobIDKeyGenerator
	StatsScope               tally.Scope `validate:"required"`
}

func (*JobsController) GetProjectJobs added in v0.18.0

func (j *JobsController) GetProjectJobs(w http.ResponseWriter, r *http.Request)

func (*JobsController) GetProjectJobsWS added in v0.18.0

func (j *JobsController) GetProjectJobsWS(w http.ResponseWriter, r *http.Request)

type ListLocksResult added in v0.34.0

type ListLocksResult struct {
	Locks []LockDetail
}

type LockDetail added in v0.34.0

type LockDetail struct {
	Name            string
	ProjectName     string
	ProjectRepo     string
	ProjectRepoPath string
	PullID          int `json:",string"`
	PullURL         string
	User            string
	Workspace       string
	Time            time.Time
}

type LocksController

type LocksController struct {
	AtlantisVersion    string                       `validate:"required"`
	AtlantisURL        *url.URL                     `validate:"required"`
	Locker             locking.Locker               `validate:"required"`
	Logger             logging.SimpleLogging        `validate:"required"`
	ApplyLocker        locking.ApplyLocker          `validate:"required"`
	VCSClient          vcs.Client                   `validate:"required"`
	LockDetailTemplate web_templates.TemplateWriter `validate:"required"`
	WorkingDir         events.WorkingDir            `validate:"required"`
	WorkingDirLocker   events.WorkingDirLocker      `validate:"required"`
	Database           db.Database                  `validate:"required"`
	DeleteLockCommand  events.DeleteLockCommand     `validate:"required"`
}

LocksController handles all requests relating to Atlantis locks.

func (*LocksController) DeleteLock

func (l *LocksController) DeleteLock(w http.ResponseWriter, r *http.Request)

DeleteLock handles deleting the lock at id and commenting back on the pull request that the lock has been deleted.

func (*LocksController) GetLock

func (l *LocksController) GetLock(w http.ResponseWriter, r *http.Request)

GetLock is the GET /locks/{id} route. It renders the lock detail view.

func (*LocksController) LockApply

func (l *LocksController) LockApply(w http.ResponseWriter, _ *http.Request)

LockApply handles creating a global apply lock. If Lock already exists it will be a no-op

func (*LocksController) UnlockApply

func (l *LocksController) UnlockApply(w http.ResponseWriter, _ *http.Request)

UnlockApply handles releasing a global apply lock. If Lock doesn't exists it will be a no-op

type StatusController

type StatusController struct {
	Logger          logging.SimpleLogging `validate:"required"`
	Drainer         *events.Drainer       `validate:"required"`
	AtlantisVersion string                `validate:"required"`
}

StatusController handles the status of Atlantis.

func (*StatusController) Get

Get is the GET /status route.

type StatusResponse

type StatusResponse struct {
	ShuttingDown    bool   `json:"shutting_down"`
	InProgressOps   int    `json:"in_progress_operations"`
	AtlantisVersion string `json:"version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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