securitygroups

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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const GUIDParam = "guid"

Variables

This section is empty.

Functions

This section is empty.

Types

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

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 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"`
}

Jump to

Keyboard shortcuts

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