# flexlb-client-go **Repository Path**: flexlb/flexlb-client-go ## Basic Information - **Project Name**: flexlb-client-go - **Description**: Go client for flexlb - **Primary Language**: Go - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: https://flexlb.gitee.io/ - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-03-23 - **Last Updated**: 2022-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FlexLB go client Flexible load balancer go client to control keepalived and haproxy ## Build ### Clone code ```sh git clone https://gitee.com/flexlb/flexlb-client-go.git ``` ### Build binary #### For Linux ```sh cd flexlb-client-go CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/flexlb-cli cmd/flexlb-client/main.go ``` ## Run ### Generage self-signed certificate #### Generate CA key and CA certs See {FLEXLB_API}/README.md #### Generate server key and certs See {FLEXLB_API}/README.md #### Generate client key and certs See {FLEXLB_API}/README.md ### Run FlexLB API server See {FLEXLB_API}/README.md ### Run FlexLB Client #### Show ready status ```sh ./flexlb-cli -status ``` ## Test #### Create instance ```sh TEMPLATE="test/instance_template.json" NAME="inst1" VIP="192.168.2.1" sed "s//${NAME}/g; s//${VIP}/g" ${TEMPLATE} > /tmp/inst1.json ./flexlb-cli -create /tmp/inst1.json ``` #### List instance ```sh ./flexlb-cli -list ./flexlb-cli -list -name inst1 ``` #### Modify instance ```sh # edit /tmp/inst1.json ./flexlb-cli -modify /tmp/inst1.json ``` #### Get instance ```sh ./flexlb-cli -get inst1 ``` #### Stop/Start instance ```sh ./flexlb-cli -stop inst1 ./flexlb-cli -start inst1 ``` #### Delete instance ```sh ./flexlb-cli -delete inst1 ```