handlers

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: Apache-2.0 Imports: 25 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware added in v0.2.3

func AuthMiddleware(roleAuth *AuthConfig) echo.MiddlewareFunc

AuthMiddleware is middleware used for each request. Includes functionality that validates the JWT tokens and user permissions.

func CreatePipeline

func CreatePipeline(c echo.Context) error

CreatePipeline accepts all data needed to create a pipeline. It then starts the create pipeline execution process async.

func CreatePipelineGetAll

func CreatePipelineGetAll(c echo.Context) error

CreatePipelineGetAll returns a json array of all pipelines which are about to get compiled and all pipelines which have been compiled.

func GetJobLogs

func GetJobLogs(c echo.Context) error

GetJobLogs returns logs from a pipeline run.

Required parameters: pipelineid - Related pipeline id pipelinerunid - Related pipeline run id

func GitWebHook added in v0.2.1

func GitWebHook(c echo.Context) error

GitWebHook handles callbacks from GitHub's webhook system.

func InitHandlers

func InitHandlers(e *echo.Echo) error

InitHandlers initializes(registers) all handlers

func ListSecrets added in v0.2.1

func ListSecrets(c echo.Context) error

ListSecrets retrieves all secrets from the vault.

func PermissionGetAll added in v0.2.3

func PermissionGetAll(c echo.Context) error

PermissionGetAll simply returns a list of all the roles available.

func PipelineCheckPeriodicSchedules added in v0.2.3

func PipelineCheckPeriodicSchedules(c echo.Context) error

PipelineCheckPeriodicSchedules validates the added periodic schedules.

func PipelineDelete added in v0.2.1

func PipelineDelete(c echo.Context) error

PipelineDelete accepts a pipeline id and deletes it from the store. It also removes the binary inside the pipeline folder.

func PipelineGet

func PipelineGet(c echo.Context) error

PipelineGet accepts a pipeline id and returns the pipeline object.

func PipelineGetAll

func PipelineGetAll(c echo.Context) error

PipelineGetAll returns all registered pipelines.

func PipelineGetAllRuns

func PipelineGetAllRuns(c echo.Context) error

PipelineGetAllRuns returns all runs about the given pipeline.

func PipelineGetAllWithLatestRun

func PipelineGetAllWithLatestRun(c echo.Context) error

PipelineGetAllWithLatestRun returns the latest of all registered pipelines included with the latest run.

func PipelineGetLatestRun

func PipelineGetLatestRun(c echo.Context) error

PipelineGetLatestRun returns the latest run of a pipeline, given by id.

func PipelineGitLSRemote

func PipelineGitLSRemote(c echo.Context) error

PipelineGitLSRemote checks for available git remote branches. This is the perfect way to check if we have access to a given repo.

func PipelineNameAvailable

func PipelineNameAvailable(c echo.Context) error

PipelineNameAvailable looks up if the given pipeline name is available and valid.

func PipelineResetToken added in v0.2.3

func PipelineResetToken(c echo.Context) error

PipelineResetToken generates a new remote trigger token for a given pipeline.

func PipelineRunGet

func PipelineRunGet(c echo.Context) error

PipelineRunGet returns details about a specific pipeline run. Required parameters are pipelineid and runid.

func PipelineStart

func PipelineStart(c echo.Context) error

PipelineStart starts a pipeline by the given id. It accepts arguments for the given pipeline. Afterwards it returns the created/scheduled pipeline run.

func PipelineStop added in v0.2.2

func PipelineStop(c echo.Context) error

PipelineStop stops a running pipeline.

func PipelineTrigger added in v0.2.3

func PipelineTrigger(c echo.Context) error

PipelineTrigger allows for a remote running of a pipeline. This endpoint does not require authentication. It will use a TOKEN that is specific to a pipeline. It can only be used by the `auto` user.

func PipelineTriggerAuth added in v0.2.3

func PipelineTriggerAuth(c echo.Context) error

PipelineTriggerAuth is a barrier before remote trigger which checks if the user is `auto`.

func PipelineUpdate added in v0.2.1

func PipelineUpdate(c echo.Context) error

PipelineUpdate updates the given pipeline.

func RemoveSecret added in v0.2.1

func RemoveSecret(c echo.Context) error

RemoveSecret removes a secret from the vault.

func SetSecret added in v0.2.1

func SetSecret(c echo.Context) error

SetSecret creates or updates a given secret

func UserAdd

func UserAdd(c echo.Context) error

UserAdd adds a new user to the store.

func UserChangePassword

func UserChangePassword(c echo.Context) error

UserChangePassword changes the password from a user.

func UserDelete

func UserDelete(c echo.Context) error

UserDelete deletes the given user

func UserGetAll

func UserGetAll(c echo.Context) error

UserGetAll returns all users stored in store.

func UserGetPermissions added in v0.2.3

func UserGetPermissions(c echo.Context) error

UserGetPermissions returns the permissions for a user.

func UserLogin

func UserLogin(c echo.Context) error

UserLogin authenticates the user with the given credentials.

func UserPutPermissions added in v0.2.3

func UserPutPermissions(c echo.Context) error

UserPutPermissions adds or updates permissions for a user.

func UserResetTriggerToken added in v0.2.3

func UserResetTriggerToken(c echo.Context) error

UserResetTriggerToken will generate and save a new Remote trigger token for a given user.

Types

type AuthConfig added in v0.2.3

type AuthConfig struct {
	RoleCategories []*gaia.UserRoleCategory
}

AuthConfig is a simple config struct to be passed into AuthMiddleware. Currently allows the ability to specify the permission roles required for each echo endpoint.

type Hook added in v0.2.1

type Hook struct {
	Signature string
	Event     string
	ID        string
	Payload   []byte
}

Hook represent a github based webhook context.

type Payload added in v0.2.1

type Payload struct {
	Repo Repository `json:"repository"`
}

Payload contains information about the event like, user, commit id and so on. All we care about for the sake of identification is the repository.

type Repository added in v0.2.1

type Repository struct {
	GitURL  string `json:"git_url"`
	SSHURL  string `json:"ssh_url"`
	HTMLURL string `json:"html_url"`
}

Repository contains information about the repository. All we care about here are the possible urls for identification.

Jump to

Keyboard shortcuts

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