loadbalancer

package
v0.0.0-...-c891ed9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

This package will help one in creating loabalancers. But this is tailor made for this application if one needs customized result, has to write one similar to this for them by calling the (master) interface. This package is capable of returining both custom response and raw from cloud depending on what you pass.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationLbRaw

type ApplicationLbRaw struct {
	CreateApplicationLbRaw *elbv2.CreateLoadBalancerOutput    `json:"createapplicationlbraw,omitempty"`
	GetApplicationLbsRaw   *elbv2.DescribeLoadBalancersOutput `json:"getapplicationlbsraw,omitempty"`
	GetApplicationLbRaw    *elbv2.LoadBalancer                `json:"getapplicationlbraw,omitempty"`
	CreateTargetGroupRaw   *elbv2.CreateTargetGroupOutput     `json:"createtargetgroupraw,omitempty"`
	GetTargetGroupRaw      *elbv2.DescribeTargetGroupsOutput  `json:"gettargetgroupraw,omitempty"`
	CreateListnersRaw      *elbv2.CreateListenerOutput        `json:"createlistnersraw,omitempty"`
	GetListnersRaw         *elbv2.DescribeListenersOutput     `json:"getlistnersraw,omitempty"`
}

This struct is a not used alone, but is used along with LoadBalanceResponse. This means, no function will which is accessible to user will send this in response but is passed via LoadBalanceResponse.

type DeleteLoadbalancerInput

type DeleteLoadbalancerInput struct {

	//optional parameter; The name of the loadbalancers which has to be deleted (only classic/network kind of loadbalancers) one can omit this if he/she needs to delete application loadbalncers.
	LbNames []string `json:"LbDns,omitempty"`

	//optional parameter; The ARN's of the loadbalancers which has to be deleted (only application kind of loadbalancers) one can omit this if he/she needs to delete classic/network loadbalncers.
	LbArns []string `json:"LbArn,omitempty"`

	//mandatory parameter; Type of loadbalancers to delete the appropriate one (classic/application).
	Type string `json:"LbArns,omitempty"`

	//optional parameter; Only when you need unfiltered result from cloud, enable this field by setting it to true. By default it is set to false.
	GetRaw bool `json:"GetRaw"`
}

func (*DeleteLoadbalancerInput) DeleteLoadbalancer

type GetLoadbalancerInput

type GetLoadbalancerInput struct {

	//optional parameter; The names of the loadbalancers in array of which the information has to be fetched (both classic/network kind of loadbalancers).
	//one can omit this if he/she is passing ARN's of loadbalancers.
	//this parameter is mandatory if one wants to fetch the data of classic load balancers.
	LbNames []string `json:"lbnames,omitempty"`

	//optional parameter; The ARN's of the loadbalancers in array of which the information has to be fetched (only application kind of loadbalancers) one can omit this if he/she is passing names of loadbalancers.
	LbArns []string `json:"lbarns,omitempty"`

	//optional parameter if getallloadbalancer is used; Type of loadbalancers to fetch the appropriate data (classic/application).
	Type string `json:"Type,omitempty"`

	//optional parameter; Only when you need unfiltered result from cloud, enable this field by setting it to true. By default it is set to false.
	GetRaw bool `json:"getraw"`
}

func (*GetLoadbalancerInput) FindApplicationLoadbalancer

func (lb *GetLoadbalancerInput) FindApplicationLoadbalancer(con aws.EstablishConnectionInput) (bool, error)

func (*GetLoadbalancerInput) FindClassicLoadbalancer

func (lb *GetLoadbalancerInput) FindClassicLoadbalancer(con aws.EstablishConnectionInput) (bool, error)

func (*GetLoadbalancerInput) GetAllApplicationLb

func (load *GetLoadbalancerInput) GetAllApplicationLb(con aws.EstablishConnectionInput) ([]LoadBalanceResponse, error)

func (*GetLoadbalancerInput) GetAllClassicLb

func (*GetLoadbalancerInput) GetAllLoadbalancer

func (*GetLoadbalancerInput) GetApplicationloadbalancers

func (load *GetLoadbalancerInput) GetApplicationloadbalancers(con aws.EstablishConnectionInput) ([]LoadBalanceResponse, error)

func (*GetLoadbalancerInput) GetArnFromLoadbalancer

func (lb *GetLoadbalancerInput) GetArnFromLoadbalancer(con aws.EstablishConnectionInput) (LoadBalanceResponse, error)

func (*GetLoadbalancerInput) GetClassicloadbalancers

func (load *GetLoadbalancerInput) GetClassicloadbalancers(con aws.EstablishConnectionInput) ([]LoadBalanceResponse, error)

func (*GetLoadbalancerInput) Getloadbalancers

type LoadBalanceCreateInput

type LoadBalanceCreateInput struct {
	//optional parameter; If you provide the name to the loadbalancer well and good, else we will name it with a default one.
	Name string `json:"name"`

	//optional parameter; The Id of vpc in which the loadbalancer has to be created. Use this only if you don't want to pass subnets directly.
	//once this option is used we automatically fetch the random subnets from this network.
	VpcId string `json:"vpcid"`

	//optional parameter; The Ids of subnet in which the loadbalancer has to be created.
	SubnetIds []string `json:"subnetids"`

	//optional parameter; The names of availability zones to which loadbalancers has to be tagged. Either this or subnets has to be passed, passing both does't work
	AvailabilityZones []string `json:"availabilityzones"`

	//optional parameter; The Ids of secutiry group to be attached to loadbalancer.
	//If not mentioned, default security group of VPC will be attached.
	SecurityGroupIds []string `json:"securitygroupids"`

	//optional parameter; This field is to select the catageory of loadbalancer ex: internal, internet-facing. If not mentioned internet-facing will be created by default.
	Scheme string `json:"scheme"`
	//mandatory parameter; The type of loadbalancer required ex: classic, application etc.
	Type string `json:"type"`

	//required only if the LB protocol is HTTPS else can be initiazed with dummy value
	SslCert   string `json:"sslCert"`
	SslPolicy string `json:"sslPolicy"`

	//mandatory parameter; The port of the loabalancer. ex: 8080, 80 etc.
	LbPort   int64 `json:"lbport"`
	InstPort int64 `json:"instport"`

	//mandatory parameter; The protocol of loadbalancer. ex: HTTPS, HTTP.
	Lbproto   string `json:"lbproto"`
	Instproto string `json:"instproto"`

	//optional parameter; The http code. ex: 200, 404 etc.
	HttpCode   string `json:"httpcode"`
	HealthPath string `json:"healthpath"`

	//optional parameter; Select Ip address type ex: ipv4, ipv6. If nothing is passed ipv4 is considered by default.
	IpAddressType string `json:"ipaddresstype"`

	//optional parameter; Only when you need unfiltered result from cloud, enable this field by setting it to true. By default it is set to false.
	GetRaw bool `json:"getraw"`
}

CreateLoadBalancer depends on this and inorder to call it one have to initiaze this struct. It has various parameter which helps in taking decision for creating loabalancer and other aspects of it.

func (*LoadBalanceCreateInput) CreateLoadBalancer

This is actual spoc for creating loadbalancer in aws and it can create both classica and applciation loabalancers. This return both custom and raw response, pass appropriate value to get the result.

type LoadBalanceDeleteResponse

type LoadBalanceDeleteResponse struct {
	LbDeleteStatus string `json:"LbDeleteStatus,omitempty"`
	LbArn          string `json:"LbArn,omitempty"`
	LbName         string `json:"LbName,omitempty"`
}

type LoadBalanceResponse

type LoadBalanceResponse struct {
	Name                   string                           `json:"name,omitempty"`
	Type                   string                           `json:"type,omitempty"`
	LbDns                  string                           `json:"lbdns,omitempty"`
	LbArn                  string                           `json:"lbarn,omitempty"`
	LbArns                 []string                         `json:"lbarns,omitempty"`
	TargetArn              interface{}                      `json:"targetarn,omitempty"`
	ListnerArn             interface{}                      `json:"listnerarn,omitempty"`
	Createdon              string                           `json:"createdon,omitempty"`
	VpcId                  string                           `json:"vpcid,omitempty"`
	Scheme                 string                           `json:"scheme,omitempty"`
	DefaultResponse        interface{}                      `json:"defaultresponse,omitempty"`
	LbDeleteStatus         string                           `json:"lbdeletestatus,omitempty"`
	ClassicLb              []LoadBalanceResponse            `json:"classiclb,omitempty"`
	ApplicationLb          []LoadBalanceResponse            `json:"applicationlb,omitempty"`
	CreateClassicLbRaw     *elb.CreateLoadBalancerOutput    `json:"createclassiclbraw,omitempty"`
	GetClassicLbsRaw       *elb.DescribeLoadBalancersOutput `json:"getclassiclbsraw,omitempty"`
	GetClassicLbRaw        *elb.LoadBalancerDescription     `json:"getclassiclbraw,omitempty"`
	CreateApplicationLbRaw ApplicationLbRaw                 `json:"createapplicationlbraw,omitempty"`
	GetApplicationLbRaw    ApplicationLbRaw                 `json:"getapplicationlbraw,omitempty"`
}

This struct is the output of CreateLoadBalancer, this holds both filetered and unfiletred response from cloud. But one has to enable flag 'GetRaw' in LoadBalanceCreateInput to get unfiletred output.

Jump to

Keyboard shortcuts

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