securitygroups
securitygroups
import "github.com/cloudfoundry/go-cf-api/internal/api/v3/securitygroups"
Index
- Constants
- Variables
- func filters(filters FilterParams) []qm.QueryMod
- type Controller
- type FilterParams
- type Links
- type ListResponse
- type Presenter
- type RelationshipData
- type Response
- type Rule
- type SecurityGroupSpace
- type presenter
Constants
const GUIDParam = "guid"
Variables
var (
securityGroupQuerier = func(qm ...qm.QueryMod) models.SecurityGroupFinisher { return models.SecurityGroups(qm...) }
)
func filters
func filters(filters FilterParams) []qm.QueryMod
type Controller
type Controller struct {
DB *sql.DB
Presenter Presenter
Permissions permissions.Querier
}
func (*Controller) Get
func (cont *Controller) Get(echoCtx echo.Context) error
func (*Controller) List
func (cont *Controller) List(echoCtx echo.Context) error
func (*Controller) readPermissionMods
func (cont *Controller) readPermissionMods(c echo.Context) ([]qm.QueryMod, error)
type FilterParams
type FilterParams struct {
Names *string `query:"names" validate:"omitempty"`
OrderBy *string `query:"order_by" validate:"omitempty,oneof=-created_at created_at -updated_at updated_at"`
}
type Links
type Links struct {
Self pagination.Link `json:"self"`
}
type ListResponse
type ListResponse struct {
Pagination *pagination.Pagination `json:"pagination"`
Resources []*Response `json:"resources"`
}
type Presenter
type Presenter interface {
ResponseObject(securityGroup *models.SecurityGroup, resourcePath string) (*Response, error)
ListResponseObject(
securityGroups models.SecurityGroupSlice,
totalResults int64,
paginationParams pagination.Params,
resourcePath string) (*ListResponse, error)
}
func NewPresenter
func NewPresenter() Presenter
type RelationshipData
type RelationshipData struct {
Data []SecurityGroupSpace `json:"data"`
}
type Response
type Response struct {
GUID string `json:"guid"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Name string `json:"name"`
Rules []Rule `json:"rules"`
GloballyEnabled map[string]bool `json:"globally_enabled"`
Links Links `json:"links"`
Relationships map[string]RelationshipData `json:"relationships"`
}
type Rule
type Rule struct {
Protocol string `json:"protocol"`
Destination string `json:"destination"`
Ports string `json:"ports,omitempty"`
Type int `json:"type,omitempty"`
Code int `json:"code,omitempty"`
Description string `json:"description,omitempty"`
Log bool `json:"log,omitempty"`
}
type SecurityGroupSpace
type SecurityGroupSpace struct {
GUID string `json:"guid"`
}
type presenter
type presenter struct{}
func (*presenter) ListResponseObject
func (p *presenter) ListResponseObject(securityGroups models.SecurityGroupSlice, totalResults int64, paginationParams pagination.Params, resourcePath string) (*ListResponse, error)
func (*presenter) ResponseObject
func (p *presenter) ResponseObject(securityGroup *models.SecurityGroup, resourcePath string) (*Response, error)
Generated by gomarkdoc