loadbalancer

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package loadbalancer will help one in creating/deleting/updating/fetching loabalancers in aws. But this is tailor made for this application if one needs customized result, he/she 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.

Package loadbalancer contains methods that responds to and with tailor made input and outputs. To talk to cloud directly build wrapper around the respective interface as per the requirements.

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

ApplicationLbRaw is a not used alone and has to be 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"`
}

DeleteLoadbalancerInput will values enough to delete a loadbalancer

func (*DeleteLoadbalancerInput) DeleteLoadbalancer

DeleteLoadbalancer is actually responsible for deleting loadbalancer asper the details passed to it.

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

GetLoadbalancerInput implements the method GetAllLoadbalancer, GetAllClassicLb, Getloadbalancers, GetAllApplicationLb to fetch the granular level details of loadbalancers.

func (*GetLoadbalancerInput) FindApplicationLoadbalancer

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

FindApplicationLoadbalancer will return ture if loadbalancer exists in the system.

func (*GetLoadbalancerInput) FindClassicLoadbalancer

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

FindClassicLoadbalancer will help in fetching the information about the selested classic loadbalancer.

func (*GetLoadbalancerInput) GetAllApplicationLb

GetAllApplicationLb will help in fetching the information about all application loadbalancer present in the region selected.

func (*GetLoadbalancerInput) GetAllClassicLb

GetAllClassicLb will fetch information about all the classic loadbalancers.

func (*GetLoadbalancerInput) GetAllLoadbalancer

GetAllLoadbalancer will help in fetching information about all loadbalancers this include both application and classic.

func (*GetLoadbalancerInput) GetApplicationloadbalancers

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

GetApplicationloadbalancers will help in fetching the information of the selected application load balancer.

func (*GetLoadbalancerInput) GetArnFromLoadbalancer

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

GetArnFromLoadbalancer will help in fetching ARN from the selected loadbalancer.

func (*GetLoadbalancerInput) GetClassicloadbalancers

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

GetClassicloadbalancers will help in fetching the information of the selected classic loadbalancer.

func (*GetLoadbalancerInput) Getloadbalancers

Getloadbalancers will fetch information about the type loadbalancer selected.

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

LoadBalanceCreateInput implements CreateLoadBalancer to create loadbalancer. It has various parameter which helps in taking decision for creating loabalancer and other aspects of it.

func (*LoadBalanceCreateInput) CreateLoadBalancer

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

LoadBalanceDeleteResponse contains filtered/unfiltered response obtained from DeleteLoadbalancer

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

LoadBalanceResponse is the output format 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