tls_policies

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Package tls_policies contains functionality for working with ECL Managed Load Balancer resources.

Example to list tls policies

listOpts := tls_policies.ListOpts{}

allPages, err := tls_policies.List(managedLoadBalancerClient, listOpts).AllPages()
if err != nil {
	panic(err)
}

allTLSPolicies, err := tls_policies.ExtractTLSPolicies(allPages)
if err != nil {
	panic(err)
}

for _, tLSPolicy := range allTLSPolicies {
	fmt.Printf("%+v\n", tLSPolicy)
}

Example to show a tls policy

id := "497f6eca-6276-4993-bfeb-53cbbbba6f08"
tLSPolicy, err := tls_policies.Show(managedLoadBalancerClient, id).Extract()
if err != nil {
	panic(err)
}

fmt.Printf("%+v\n", tLSPolicy)

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTLSPoliciesInto

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

ExtractTLSPoliciesInto interprets the results of a single page from a List() call, producing a slice of tls policy entities.

func List

func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns a Pager which allows you to iterate over a collection of tls policies. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type ListOpts

type ListOpts struct {

	// - ID of the resource
	ID string `q:"id"`

	// - Name of the resource
	Name string `q:"name"`

	// - Description of the resource
	Description string `q:"description"`

	// - Whether the TLS policy will be set `policy.tls_policy_id` when that is not specified
	Default bool `q:"default"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the tls policy attributes you want to see returned.

func (ListOpts) ToTLSPolicyListQuery

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

ToTLSPolicyListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type ShowResult

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

ShowResult represents the result of a Show operation. Call its Extract method to interpret it as a TLSPolicy.

func Show

func Show(c *eclcloud.ServiceClient, id string) (r ShowResult)

Show retrieves a specific tls policy based on its unique ID.

func (ShowResult) Extract

func (r ShowResult) Extract() (*TLSPolicy, error)

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

func (ShowResult) ExtractInto

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

ExtractInto interprets any commonResult as a tls policy, if possible.

type TLSPolicy

type TLSPolicy struct {

	// - ID of the TLS policy
	ID string `json:"id"`

	// - Name of the TLS policy
	Name string `json:"name"`

	// - Description of the TLS policy
	Description string `json:"description"`

	// - Whether the TLS policy will be set `policy.tls_policy_id` when that is not specified
	Default bool `json:"default"`

	// - The list of acceptable TLS protocols in the policy that specifed this TLS policty
	TLSProtocols []string `json:"tls_protocols"`

	// - The list of acceptable TLS ciphers in the policy that specifed this TLS policty
	TLSCiphers []string `json:"tls_ciphers"`
}

TLSPolicy represents a tls policy.

func ExtractTLSPolicies

func ExtractTLSPolicies(r pagination.Page) ([]TLSPolicy, error)

ExtractTLSPolicies accepts a Page struct, specifically a NetworkPage struct, and extracts the elements into a slice of TLSPolicy structs. In other words, a generic collection is mapped into a relevant slice.

type TLSPolicyPage

type TLSPolicyPage struct {
	pagination.LinkedPageBase
}

TLSPolicyPage is the page returned by a pager when traversing over a collection of tls policy.

func (TLSPolicyPage) IsEmpty

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

IsEmpty checks whether a TLSPolicyPage struct is empty.

Directories

Path Synopsis
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Jump to

Keyboard shortcuts

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