buildpacks

package
v0.0.0-...-7a6a509 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateAwaitingUpload = "AWAITING_UPLOAD"
	StateReady          = "READY"
)
View Source
const GUIDParam = "guid"

Variables

This section is empty.

Functions

func GetBuildpackState

func GetBuildpackState(buildpack *models.Buildpack) string

Types

type Controller

type Controller struct {
	DB                  *sql.DB
	Presenter           Presenter
	LabelSelectorParser metadata.LabelSelectorParser
}

func (*Controller) Get

func (cont *Controller) Get(echoCtx echo.Context) error

Get godoc @Summary Show a buildpack @Description Retrieve all buildpacks the user has access to. @Tags Buildpacks @Param guid path string true "Buildpack GUID" @Success 200 {object} Response @Success 404 {object} interface{} @Failure 400 {object} v3.CfAPIError @Failure 500 {object} v3.CfAPIError @Router /buildpacks/{guid} [get]

func (*Controller) List

func (cont *Controller) List(echoCtx echo.Context) error

func (*Controller) Post

func (cont *Controller) Post(echoCtx echo.Context) error

PostBuildpack godoc @Summary Create a buildpack @Description Create a new buildpack @Tags Buildpacks @accept json @produce json @Success 201 {object} Response @Success 404 {object} interface{} @Failure 400 {object} v3.CfAPIError @Failure 500 {object} v3.CfAPIError @Router /buildpacks [post]

type FilterParams

type FilterParams struct {
	Names         *string `query:"names"`
	Stacks        *string `query:"stacks"`
	OrderBy       string  `query:"order_by" validate:"oneof=created_at -created_at updated_at -updated_at position -position"`
	LabelSelector string  `query:"label_selector"`
}

func DefaultFilters

func DefaultFilters() FilterParams

type ListResponse

type ListResponse struct {
	Pagination *pagination.Pagination `json:"pagination"`
	Resources  []*Response            `json:"resources"`
}

type PostRequest

type PostRequest struct {
	Name     string  `json:"name" validate:"required,min=1,max=250"`
	Stack    *string `json:"stack" validate:"omitempty,max=250"`
	Position int     `json:"position" validate:"gte=1"`
	Enabled  bool    `json:"enabled"`
	Locked   bool    `json:"locked"`
}

func DefaultPostRequest

func DefaultPostRequest() PostRequest

type Presenter

type Presenter interface {
	ResponseObject(buildpack *models.Buildpack, resourcePath string) (*Response, error)
	ListResponseObject(
		buildpacks models.BuildpackSlice,
		totalResults int64,
		paginationParams pagination.Params,
		resourcePath string) (*ListResponse, error)
}

func NewPresenter

func NewPresenter() Presenter

type Response

type Response struct {
	GUID      string            `json:"guid"`
	CreatedAt string            `json:"created_at"`
	UpdatedAt string            `json:"updated_at"`
	Name      string            `json:"name"`
	Stack     null.String       `json:"stack"`
	State     string            `json:"state"`
	Filename  null.String       `json:"filename"`
	Position  int               `json:"position"`
	Enabled   null.Bool         `json:"enabled"`
	Locked    null.Bool         `json:"locked"`
	Metadata  metadata.Metadata `json:"metadata"`
	Links     struct {
		Self   pagination.Link `json:"self"`
		Upload pagination.Link `json:"upload"`
	} `json:"links"`
}

Jump to

Keyboard shortcuts

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