handler

package
v0.0.0-...-66c98c8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 166 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScheduleHourly : 'Hourly'
	ScheduleHourly = "Hourly"
	// ScheduleDaily : 'Daily'
	ScheduleDaily = "Daily"
	// ScheduleWeekly : 'Weekly'
	ScheduleWeekly = "Weekly"
	// ScheduleCustom : 'Custom'
	ScheduleCustom = "Custom"
	// ScheduleManual : 'Manual'
	ScheduleManual = "Manual"
	// ScheduleNone : 'None'
	ScheduleNone = "None"
)

Variables

This section is empty.

Functions

func New

func New() http.Handler

New returns http handler for API V2.0

Types

type BaseAPI

type BaseAPI struct{}

BaseAPI base API handler

func (*BaseAPI) BuildQuery

func (b *BaseAPI) BuildQuery(_ context.Context, query, sort *string, pageNumber, pageSize *int64) (*q.Query, error)

BuildQuery builds the query model according to the query string

func (*BaseAPI) GetSecurityContext

func (*BaseAPI) GetSecurityContext(ctx context.Context) (security.Context, error)

GetSecurityContext from the provided context

func (*BaseAPI) HasPermission

func (b *BaseAPI) HasPermission(ctx context.Context, action rbac.Action, resource rbac.Resource) bool

HasPermission returns true when the request has action permission on resource

func (*BaseAPI) HasProjectPermission

func (b *BaseAPI) HasProjectPermission(ctx context.Context, projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool

HasProjectPermission returns true when the request has action permission on project subresource

func (b *BaseAPI) Links(_ context.Context, u *url.URL, total, pageNumber, pageSize int64) lib.Links

Links return Links based on the provided pagination information

func (*BaseAPI) Prepare

func (*BaseAPI) Prepare(_ context.Context, _ string, _ interface{}) middleware.Responder

Prepare default prepare for operation

func (*BaseAPI) RequireAuthenticated

func (b *BaseAPI) RequireAuthenticated(ctx context.Context) error

RequireAuthenticated checks it's authenticated according to the security context

func (*BaseAPI) RequireProjectAccess

func (b *BaseAPI) RequireProjectAccess(ctx context.Context, projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) error

RequireProjectAccess checks the permission against the resources according to the context An error will be returned if it doesn't meet the requirement

func (*BaseAPI) RequireSolutionUserAccess

func (b *BaseAPI) RequireSolutionUserAccess(ctx context.Context) error

RequireSolutionUserAccess check if current user is internal service

func (*BaseAPI) RequireSystemAccess

func (b *BaseAPI) RequireSystemAccess(ctx context.Context, action rbac.Action, subresource ...rbac.Resource) error

RequireSystemAccess checks the system admin permission according to the security context

func (*BaseAPI) SendError

func (*BaseAPI) SendError(_ context.Context, err error) middleware.Responder

SendError returns response for the err

type ErrResponder

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

ErrResponder error responder

func NewErrResponder

func NewErrResponder(err error) *ErrResponder

NewErrResponder returns responder for err

func (*ErrResponder) WriteResponse

func (r *ErrResponder) WriteResponse(rw http.ResponseWriter, _ runtime.Producer)

WriteResponse ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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