api

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const APIPrefix string = "api"

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, req *http.Request, log logging.Logger, err error)

func DeleteConfigurationHandlerFunc

func DeleteConfigurationHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func DeleteCredentialHandlerFunc

func DeleteCredentialHandlerFunc(log logging.Logger) http.HandlerFunc

func DeleteDeploymentHandlerFunc

func DeleteDeploymentHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetAccountHandlerFunc

func GetAccountHandlerFunc(lister accounts.AccountList, log logging.Logger) http.HandlerFunc

GetAccountHandlerFunc returns a handler for the Get Account (by name) endpoint.

func GetAccountsHandlerFunc

func GetAccountsHandlerFunc(lister accounts.AccountList, log logging.Logger) http.HandlerFunc

GetAccountsHandlerFunc returns a handler for the account list.

func GetConfigFilesHandlerFunc

func GetConfigFilesHandlerFunc(base util.AbsolutePath, filesService files.FilesService, log logging.Logger) http.HandlerFunc

func GetConfigurationHandlerFunc

func GetConfigurationHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetConfigurationsHandlerFunc

func GetConfigurationsHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetCredentialHandlerFunc

func GetCredentialHandlerFunc(log logging.Logger) http.HandlerFunc

func GetCredentialsHandlerFunc

func GetCredentialsHandlerFunc(log logging.Logger) http.HandlerFunc

func GetDeploymentHandlerFunc

func GetDeploymentHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetDeploymentsHandlerFunc

func GetDeploymentsHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetEntrypointsHandlerFunc added in v1.1.5

func GetEntrypointsHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func GetFileHandlerFunc

func GetFileHandlerFunc(base util.AbsolutePath, filesService files.FilesService, pathsService paths.PathsService, log logging.Logger) http.HandlerFunc

func InternalError

func InternalError(w http.ResponseWriter, req *http.Request, log logging.Logger, err error)

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter, req *http.Request, log logging.Logger)

func NewGetConfigPythonPackagesHandler

func NewGetConfigPythonPackagesHandler(base util.AbsolutePath, log logging.Logger) *getConfigPythonPackagesHandler

func NewGetConfigRPackagesHandler

func NewGetConfigRPackagesHandler(base util.AbsolutePath, log logging.Logger) *getConfigRPackagesHandler

func NotFound

func NotFound(w http.ResponseWriter, log logging.Logger, err error)

func PatchDeploymentHandlerFunc

func PatchDeploymentHandlerFunc(
	base util.AbsolutePath,
	log logging.Logger) http.HandlerFunc

func PostAccountVerifyHandlerFunc

func PostAccountVerifyHandlerFunc(lister accounts.AccountList, log logging.Logger) http.HandlerFunc

func PostConfigFilesHandlerFunc

func PostConfigFilesHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func PostCredentialFuncHandler

func PostCredentialFuncHandler(log logging.Logger) http.HandlerFunc

func PostDeploymentHandlerFunc

func PostDeploymentHandlerFunc(
	base util.AbsolutePath,
	log logging.Logger,
	accountList accounts.AccountList,
	emitter events.Emitter) http.HandlerFunc

func PostDeploymentsHandlerFunc

func PostDeploymentsHandlerFunc(
	base util.AbsolutePath,
	log logging.Logger,
	accountList accounts.AccountList) http.HandlerFunc

func PostInspectHandlerFunc

func PostInspectHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func PostTestCredentialsHandlerFunc

func PostTestCredentialsHandlerFunc(log logging.Logger) http.HandlerFunc

func ProjectDirFromRequest

func ProjectDirFromRequest(base util.AbsolutePath, w http.ResponseWriter, req *http.Request, log logging.Logger) (util.AbsolutePath, util.RelativePath, error)

ProjectDirFromRequest returns the project directory from the request query parameter "dir". If the directory does not exist, it returns a 404. If the directory is not a subdirectory of the base directory, it returns a 400. Other errors return a 500.

func PutConfigurationHandlerFunc

func PutConfigurationHandlerFunc(base util.AbsolutePath, log logging.Logger) http.HandlerFunc

func RouterHandlerFunc

func RouterHandlerFunc(base util.AbsolutePath, lister accounts.AccountList, log logging.Logger, eventServer *sse.Server, emitter events.Emitter) http.HandlerFunc

func ToPath

func ToPath(elements ...string) string

Types

type MockFilesService

type MockFilesService struct {
	mock.Mock
	files.FilesService
}

func (*MockFilesService) GetFile

func (m *MockFilesService) GetFile(p util.AbsolutePath, matchList matcher.MatchList) (*files.File, error)

type MockPathsService

type MockPathsService struct {
	mock.Mock
	paths.PathsService
}

func (*MockPathsService) IsSafe

func (m *MockPathsService) IsSafe(p util.AbsolutePath) (bool, error)

type PatchDeploymentRequestBody

type PatchDeploymentRequestBody struct {
	ConfigName string `json:"configurationName"`
}

type PostAccountVerifyResponse

type PostAccountVerifyResponse struct {
	*connect.User
	Error string `json:"error"`
}

type PostCredentialsRequest

type PostCredentialsRequest struct {
	Name   string `json:"name"`
	URL    string `json:"url"`
	ApiKey string `json:"apiKey"`
}

type PostCredentialsResponse

type PostCredentialsResponse = credentials.Credential

type PostDeploymentRequestBody

type PostDeploymentRequestBody struct {
	AccountName string `json:"account"`
	ConfigName  string `json:"config"`
}

type PostDeploymentsReponse

type PostDeploymentsReponse struct {
	LocalID state.LocalDeploymentID `json:"localId"` // Unique ID of this publishing operation. Only valid for this run of the agent.
}

type PostDeploymentsRequestBody

type PostDeploymentsRequestBody struct {
	AccountName string `json:"account"`
	ConfigName  string `json:"config"`
	SaveName    string `json:"saveName"`
}

type PostPackagesPythonScanHandler

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

func NewPostPackagesPythonScanHandler

func NewPostPackagesPythonScanHandler(base util.AbsolutePath, log logging.Logger) *PostPackagesPythonScanHandler

func (*PostPackagesPythonScanHandler) ServeHTTP

type PostPackagesPythonScanRequest

type PostPackagesPythonScanRequest struct {
	Python   string `json:"python"`
	SaveName string `json:"saveName"`
}

type PostPackagesRScanHandler

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

func NewPostPackagesRScanHandler

func NewPostPackagesRScanHandler(base util.AbsolutePath, log logging.Logger) *PostPackagesRScanHandler

func (*PostPackagesRScanHandler) ServeHTTP

type PostPackagesRScanRequest

type PostPackagesRScanRequest struct {
	SaveName string `json:"saveName"`
}

type PostTestCredentialsRequestBody

type PostTestCredentialsRequestBody struct {
	URL      string  `json:"url"`
	ApiKey   string  `json:"apiKey"`
	Insecure bool    `json:"insecure"`
	Timeout  float32 `json:"timeout"`
}

type PostTestCredentialsResponseBody

type PostTestCredentialsResponseBody struct {
	User  *connect.User     `json:"user"`
	Error *types.AgentError `json:"error"`
}

type Service

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

func NewService

func NewService(
	fragment string,
	interactive bool,
	openBrowserAt string,
	theme string,
	listen string,
	accessLog bool,
	tlsKeyFile string,
	tlsCertFile string,
	dir util.AbsolutePath,
	lister accounts.AccountList,
	log logging.Logger,
	eventServer *sse.Server,
	emitter events.Emitter) *Service

func (*Service) Run

func (svc *Service) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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