controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHTTPTestAuthentication

func SetupHTTPTestAuthentication(req *http.Request, organization dbmodels.Organization, orgMember dbmodels.IOrganizationMember)

SetupHTTPTestAuthentication sets up headers in the given request, so that the request is authenticated as the given organization member.

Types

type Context

type Context struct {
	Db                             *gorm.DB
	AutoProcessReleaseInBackground bool
	WaitGroup                      *sync.WaitGroup
}

func NewContext

func NewContext(db *gorm.DB, wg *sync.WaitGroup) Context

func (Context) About

func (ctx Context) About(ginctx *gin.Context)

func (Context) CreateApplication

func (ctx Context) CreateApplication(ginctx *gin.Context)

func (Context) CreateApplicationApprovalRulesetBinding

func (ctx Context) CreateApplicationApprovalRulesetBinding(ginctx *gin.Context)

func (Context) CreateApprovalRuleset

func (ctx Context) CreateApprovalRuleset(ginctx *gin.Context)

func (*Context) CreateRelease

func (ctx *Context) CreateRelease(ginctx *gin.Context)

func (Context) DeleteApplicationApprovalRulesetBindingProposal

func (ctx Context) DeleteApplicationApprovalRulesetBindingProposal(ginctx *gin.Context)

func (Context) DeleteApplicationProposal

func (ctx Context) DeleteApplicationProposal(ginctx *gin.Context)

func (Context) DeleteApprovalRulesetProposal

func (ctx Context) DeleteApprovalRulesetProposal(ginctx *gin.Context)

func (Context) GetApplication

func (ctx Context) GetApplication(ginctx *gin.Context)

func (Context) GetApplicationApprovalRulesetBinding

func (ctx Context) GetApplicationApprovalRulesetBinding(ginctx *gin.Context)

func (Context) GetApplicationApprovalRulesetBindingProposal

func (ctx Context) GetApplicationApprovalRulesetBindingProposal(ginctx *gin.Context)

func (Context) GetApplicationApprovalRulesetBindingVersion

func (ctx Context) GetApplicationApprovalRulesetBindingVersion(ginctx *gin.Context)

func (Context) GetApplicationProposal

func (ctx Context) GetApplicationProposal(ginctx *gin.Context)

func (Context) GetApplicationVersion

func (ctx Context) GetApplicationVersion(ginctx *gin.Context)

func (Context) GetApprovalRuleset

func (ctx Context) GetApprovalRuleset(ginctx *gin.Context)

func (Context) GetApprovalRulesetProposal

func (ctx Context) GetApprovalRulesetProposal(ginctx *gin.Context)

func (Context) GetApprovalRulesetVersion

func (ctx Context) GetApprovalRulesetVersion(ginctx *gin.Context)

func (Context) GetCurrentOrganization

func (ctx Context) GetCurrentOrganization(ginctx *gin.Context)

func (Context) GetOrganization

func (ctx Context) GetOrganization(ginctx *gin.Context)

func (Context) GetRelease

func (ctx Context) GetRelease(ginctx *gin.Context)

func (Context) GetReleaseEvents

func (ctx Context) GetReleaseEvents(ginctx *gin.Context)

func (Context) InstallAuthenticatedRoutes

func (ctx Context) InstallAuthenticatedRoutes(rg *gin.RouterGroup)

func (Context) InstallUnauthenticatedRoutes

func (ctx Context) InstallUnauthenticatedRoutes(rg *gin.RouterGroup)

func (Context) ListApplicationApprovalRulesetBindingProposals

func (ctx Context) ListApplicationApprovalRulesetBindingProposals(ginctx *gin.Context)

func (Context) ListApplicationApprovalRulesetBindingVersions

func (ctx Context) ListApplicationApprovalRulesetBindingVersions(ginctx *gin.Context)

func (Context) ListApplicationApprovalRulesetBindings

func (ctx Context) ListApplicationApprovalRulesetBindings(ginctx *gin.Context)

func (Context) ListApplicationProposals

func (ctx Context) ListApplicationProposals(ginctx *gin.Context)

func (Context) ListApplicationVersions

func (ctx Context) ListApplicationVersions(ginctx *gin.Context)

func (Context) ListApplications

func (ctx Context) ListApplications(ginctx *gin.Context)

func (Context) ListApprovalRulesetProposals

func (ctx Context) ListApprovalRulesetProposals(ginctx *gin.Context)

func (Context) ListApprovalRulesetVersions

func (ctx Context) ListApprovalRulesetVersions(ginctx *gin.Context)

func (Context) ListApprovalRulesets

func (ctx Context) ListApprovalRulesets(ginctx *gin.Context)

func (Context) ListReleases

func (ctx Context) ListReleases(ginctx *gin.Context)

func (Context) UpdateApplication

func (ctx Context) UpdateApplication(ginctx *gin.Context)

func (Context) UpdateApplicationApprovalRulesetBinding

func (ctx Context) UpdateApplicationApprovalRulesetBinding(ginctx *gin.Context)

func (Context) UpdateApplicationApprovalRulesetBindingProposal

func (ctx Context) UpdateApplicationApprovalRulesetBindingProposal(ginctx *gin.Context)

func (Context) UpdateApplicationApprovalRulesetBindingProposalState

func (ctx Context) UpdateApplicationApprovalRulesetBindingProposalState(ginctx *gin.Context)

func (Context) UpdateApplicationProposal

func (ctx Context) UpdateApplicationProposal(ginctx *gin.Context)

func (Context) UpdateApplicationProposalState

func (ctx Context) UpdateApplicationProposalState(ginctx *gin.Context)

func (Context) UpdateApprovalRuleset

func (ctx Context) UpdateApprovalRuleset(ginctx *gin.Context)

func (Context) UpdateApprovalRulesetProposal

func (ctx Context) UpdateApprovalRulesetProposal(ginctx *gin.Context)

func (Context) UpdateApprovalRulesetProposalState

func (ctx Context) UpdateApprovalRulesetProposalState(ginctx *gin.Context)

func (Context) UpdateCurrentOrganization

func (ctx Context) UpdateCurrentOrganization(ginctx *gin.Context)

func (Context) UpdateOrganization

func (ctx Context) UpdateOrganization(ginctx *gin.Context)

func (Context) UpdateRelease

func (ctx Context) UpdateRelease(ginctx *gin.Context)

type HTTPTestContext

type HTTPTestContext struct {
	Db *gorm.DB

	Engine        *gin.Engine
	ControllerCtx Context
	Recorder      *httptest.ResponseRecorder
	WaitGroup     *sync.WaitGroup

	Org            dbmodels.Organization
	ServiceAccount dbmodels.ServiceAccount
}

func SetupHTTPTestContext

func SetupHTTPTestContext(initializer func(ctx *HTTPTestContext, tx *gorm.DB) error) (HTTPTestContext, error)

func (HTTPTestContext) BodyJSON

func (ctx HTTPTestContext) BodyJSON() (gin.H, error)

BodyJSON returns the response body as a JSON object.

func (HTTPTestContext) NewRequestWithAuth

func (ctx HTTPTestContext) NewRequestWithAuth(method string, url string, body interface{}) (*http.Request, error)

NewRequestWithAuth creates a new Request which is already authenticated as `ctx.serviceAccount`.

`body` is either nil, or an object which will be marshalled into JSON as the request body.

func (HTTPTestContext) ServeHTTP

func (ctx HTTPTestContext) ServeHTTP(req *http.Request)

Jump to

Keyboard shortcuts

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