buildpacks
buildpacks
import "github.com/cloudfoundry/go-cf-api/internal/api/v3/buildpacks"
Index
- Constants
- Variables
- func GetBuildpackState(buildpack *models.Buildpack) string
- func filters(filters FilterParams) []qm.QueryMod
- type Controller
- type FilterParams
- type ListResponse
- type PostRequest
- type Presenter
- type Response
- type presenter
Constants
const (
StateAwaitingUpload = "AWAITING_UPLOAD"
StateReady = "READY"
)
const GUIDParam = "guid"
Variables
var (
buildpackQuerier = func(qm ...qm.QueryMod) models.BuildpackFinisher { return models.Buildpacks(qm...) }
buildpackInserter models.BuildpackInserter = models.Buildpacks()
buildpackUpdater models.BuildpackUpdater = models.Buildpacks()
)
func GetBuildpackState
func GetBuildpackState(buildpack *models.Buildpack) string
func filters
func filters(filters FilterParams) []qm.QueryMod
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"`
}
type presenter
type presenter struct{}
func (*presenter) ListResponseObject
func (p *presenter) ListResponseObject(buildpacks models.BuildpackSlice, totalResults int64, paginationParams pagination.Params, resourcePath string) (*ListResponse, error)
func (*presenter) ResponseObject
func (p *presenter) ResponseObject(buildpack *models.Buildpack, resourcePath string) (*Response, error)
Generated by gomarkdoc