listeners

package
v0.6.28 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create accepts a CreateOpts struct and creates a new listener using the values provided.

func Delete

func Delete(c *gcorecloud.ServiceClient, listenerID string) (r tasks.Result)

Delete accepts a unique ID and deletes the listener associated with it.

func ExtractListenerIDFromTask

func ExtractListenerIDFromTask(task *tasks.Task) (string, error)

func ExtractListenersInto

func ExtractListenersInto(r pagination.Page, v interface{}) error

func Update

func Update(c *gcorecloud.ServiceClient, listenerID string, opts UpdateOptsBuilder) (r tasks.Result)

Update accepts a UpdateOpts struct and updates an existing listener using the values provided. For more information, see the Create function.

Types

type CreateOpts

type CreateOpts struct {
	Name                 string             `json:"name" required:"true" validate:"required,name"`
	Protocol             types.ProtocolType `json:"protocol" required:"true"`
	ProtocolPort         int                `json:"protocol_port" required:"true"`
	LoadBalancerID       string             `json:"loadbalancer_id" required:"true"`
	InsertXForwarded     bool               `json:"insert_x_forwarded"`
	SecretID             string             `json:"secret_id,omitempty"`
	SNISecretID          []string           `json:"sni_secret_id,omitempty"`
	AllowedCIDRS         []string           `json:"allowed_cidrs,omitempty" validate:"omitempty,dive,cidr"`
	TimeoutClientData    *int               `json:"timeout_client_data,omitempty"`
	TimeoutMemberData    *int               `json:"timeout_member_data,omitempty"`
	TimeoutMemberConnect *int               `json:"timeout_member_connect,omitempty"`
}

CreateOpts represents options used to create a listener pool.

func (CreateOpts) ToListenerCreateMap

func (opts CreateOpts) ToListenerCreateMap() (map[string]interface{}, error)

ToListenerCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToListenerCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Listener.

func Get

func Get(c *gcorecloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific listener based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Listener, error)

Extract is a function that accepts a result and extracts a listener resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type ListOpts

type ListOpts struct {
	LoadBalancerID *string `q:"loadbalancer_id"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToListenerListQuery

func (opts ListOpts) ToListenerListQuery() (string, error)

ToListenerListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToListenerListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Listener

type Listener struct {
	PoolCount          int                      `json:"pool_count"`
	ProtocolPort       int                      `json:"protocol_port"`
	Protocol           types.ProtocolType       `json:"protocol"`
	Name               string                   `json:"name"`
	ID                 string                   `json:"id"`
	ProvisioningStatus types.ProvisioningStatus `json:"provisioning_status"`
	OperationStatus    types.OperatingStatus    `json:"operating_status"`
	CreatorTaskID      *string                  `json:"creator_task_id"`
	TaskID             *string                  `json:"task_id"`
	SecretID           *string                  `json:"secret_id"`
	SNISecretID        []string                 `json:"sni_secret_id,omitempty"`
	AllowedCIDRS       []string                 `json:"allowed_cidrs,omitempty" validate:"omitempty,dive,cidr"`
}

Listener represents a listener structure.

func ExtractListeners

func ExtractListeners(r pagination.Page) ([]Listener, error)

ExtractListener accepts a Page struct, specifically a ListenerPage struct, and extracts the elements into a slice of Listener structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

func ListAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Listener, error)

ListAll returns all LBs

func (Listener) IsDeleted

func (l Listener) IsDeleted() bool

type ListenerPage

type ListenerPage struct {
	pagination.LinkedPageBase
}

ListenerPage is the page returned by a pager when traversing over a collection of listeners.

func (ListenerPage) IsEmpty

func (r ListenerPage) IsEmpty() (bool, error)

IsEmpty checks whether a ListenerPage struct is empty.

func (ListenerPage) NextPageURL

func (r ListenerPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of listeners has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type ListenerTaskResult

type ListenerTaskResult struct {
	Listeners []string `json:"listeners"`
}

type UpdateOpts

type UpdateOpts struct {
	Name                 string   `json:"name,omitempty"`
	SecretID             string   `json:"secret_id,omitempty"`
	SNISecretID          []string `json:"sni_secret_id,omitempty"`
	AllowedCIDRS         []string `json:"allowed_cidrs,omitempty" validate:"omitempty,dive,cidr"`
	TimeoutClientData    *int     `json:"timeout_client_data,omitempty"`
	TimeoutMemberData    *int     `json:"timeout_member_data,omitempty"`
	TimeoutMemberConnect *int     `json:"timeout_member_connect,omitempty"`
}

UpdateOpts represents options used to update a listener.

func (UpdateOpts) ToListenerUpdateMap

func (opts UpdateOpts) ToListenerUpdateMap() (map[string]interface{}, error)

ToListenerUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToListenerUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Listener.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Listener, error)

Extract is a function that accepts a result and extracts a listener resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis
listeners unit tests
listeners unit tests

Jump to

Keyboard shortcuts

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