Skip to content

Commit

Permalink
update lint
Browse files Browse the repository at this point in the history
  • Loading branch information
botranvan committed Jun 21, 2024
1 parent f26e36b commit 5da9909
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions loadbalancer_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type CloudLoadBalancerMemberService interface {
Get(ctx context.Context, poolID, id string) (*CloudLoadBalancerMember, error)
Update(ctx context.Context, poolID, id string, req *CloudLoadBalancerMemberUpdateRequest) (*CloudLoadBalancerMember, error)
Delete(ctx context.Context, poolID, id string) error
Create(ctx context.Context, poolID string, req *CloudLoadBalancerCreateRequest) (*CloudLoadBalancerMember, error)
Create(ctx context.Context, poolID string, req *CloudLoadBalancerMemberCreateRequest) (*CloudLoadBalancerMember, error)
BatchUpdate(ctx context.Context, poolID string, members *CloudLoadBalancerBatchMemberUpdateRequest) error
}

Expand All @@ -42,8 +42,8 @@ type CloudLoadBalancerBatchMemberUpdateRequest struct {
Members []CloudLoadBalancerExtendMemberUpdateRequest `json:"members"`
}

// CloudLoadBalancerCreateRequest represents create member request payload
type CloudLoadBalancerCreateRequest struct {
// CloudLoadBalancerMemberCreateRequest represents create member request payload
type CloudLoadBalancerMemberCreateRequest struct {
Name string `json:"name"`
Weight int `json:"weight,omitempty"`
Address string `json:"address"`
Expand Down Expand Up @@ -187,9 +187,9 @@ func (m *cloudLoadBalancerMemberResource) Delete(ctx context.Context, poolID, id
}

// Create - Create a new member
func (m *cloudLoadBalancerMemberResource) Create(ctx context.Context, poolID string, mcr *CloudLoadBalancerCreateRequest) (*CloudLoadBalancerMember, error) {
func (m *cloudLoadBalancerMemberResource) Create(ctx context.Context, poolID string, mcr *CloudLoadBalancerMemberCreateRequest) (*CloudLoadBalancerMember, error) {
var data struct {
CloudLoadBalancerMember *CloudLoadBalancerCreateRequest `json:"member"`
CloudLoadBalancerMember *CloudLoadBalancerMemberCreateRequest `json:"member"`
}
data.CloudLoadBalancerMember = mcr
req, err := m.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, m.resourcePath(poolID), &data)
Expand Down
64 changes: 32 additions & 32 deletions loadbalancer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,46 +53,46 @@ type CloudLoadBalancerPoolMemberRequest struct {

// CloudLoadBalancerPoolCreateRequest represents create new pool request payload.
type CloudLoadBalancerPoolCreateRequest struct {
LBAlgorithm string `json:"lb_algorithm"`
ListenerID string `json:"listener_id,omitempty"`
Name *string `json:"name,omitempty"`
Protocol string `json:"protocol"`
SessionPersistence *SessionPersistence `json:"session_persistence,omitempty"`
CloudLoadBalancerHealthMonitor *CloudLoadBalancerPoolHealthMonitorRequest `json:"healthmonitor,omitempty"`
Members []CloudLoadBalancerPoolMemberRequest `json:"members,omitempty"`
LBAlgorithm string `json:"lb_algorithm"`
ListenerID string `json:"listener_id,omitempty"`
Name *string `json:"name,omitempty"`
Protocol string `json:"protocol"`
SessionPersistence *SessionPersistence `json:"session_persistence,omitempty"`
HealthMonitor *CloudLoadBalancerPoolHealthMonitorRequest `json:"healthmonitor,omitempty"`
Members []CloudLoadBalancerPoolMemberRequest `json:"members,omitempty"`
}

// CloudLoadBalancerPoolUpdateRequest represents update pool request payload.
type CloudLoadBalancerPoolUpdateRequest struct {
AdminStateUp *bool `json:"admin_state_up,omitempty"`
Description *string `json:"description,omitempty"`
LBAlgorithm *string `json:"lb_algorithm,omitempty"`
Name *string `json:"name,omitempty"`
SessionPersistence *SessionPersistence `json:"session_persistence"`
Members []CloudLoadBalancerPoolMemberRequest `json:"members,omitempty"`
CloudLoadBalancerHealthMonitor *CloudLoadBalancerPoolHealthMonitorRequest `json:"healthmonitor,omitempty"`
AdminStateUp *bool `json:"admin_state_up,omitempty"`
Description *string `json:"description,omitempty"`
LBAlgorithm *string `json:"lb_algorithm,omitempty"`
Name *string `json:"name,omitempty"`
SessionPersistence *SessionPersistence `json:"session_persistence"`
Members []CloudLoadBalancerPoolMemberRequest `json:"members,omitempty"`
HealthMonitor *CloudLoadBalancerPoolHealthMonitorRequest `json:"healthmonitor,omitempty"`
}

// CloudLoadBalancerPool contains pool information.
type CloudLoadBalancerPool struct {
ID string `json:"id"`
TenandID string `json:"tenant_id"`
Description string `json:"description"`
LBAlgorithm string `json:"lb_algorithm"`
Name string `json:"name"`
CloudLoadBalancerHealthMonitor *CloudLoadBalancerHealthMonitor `json:"healthmonitor"`
UpdatedAt string `json:"updated_at"`
OperatingStatus string `json:"operating_status"`
Listeners []resourceID `json:"listeners"`
SessionPersistence *SessionPersistence `json:"session_persistence"`
ProvisoningStatus string `json:"provisioning_status"`
ProjectID string `json:"project_id"`
LoadBalancers []resourceID `json:"loadbalancers"`
AdminStateUp bool `json:"admin_state_up"`
Protocol string `json:"protocol"`
CreatedAt string `json:"created_at"`
HealthMonitorID string `json:"healthmonitor_id"`
Members []CloudLoadBalancerMember `json:"members"`
ID string `json:"id"`
TenandID string `json:"tenant_id"`
Description string `json:"description"`
LBAlgorithm string `json:"lb_algorithm"`
Name string `json:"name"`
HealthMonitor *CloudLoadBalancerHealthMonitor `json:"healthmonitor"`
UpdatedAt string `json:"updated_at"`
OperatingStatus string `json:"operating_status"`
Listeners []resourceID `json:"listeners"`
SessionPersistence *SessionPersistence `json:"session_persistence"`
ProvisoningStatus string `json:"provisioning_status"`
ProjectID string `json:"project_id"`
LoadBalancers []resourceID `json:"loadbalancers"`
AdminStateUp bool `json:"admin_state_up"`
Protocol string `json:"protocol"`
CreatedAt string `json:"created_at"`
HealthMonitorID string `json:"healthmonitor_id"`
Members []CloudLoadBalancerMember `json:"members"`
}

type cloudLoadBalancerPoolResource struct {
Expand Down

0 comments on commit 5da9909

Please sign in to comment.