Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.17 KB

File metadata and controls

54 lines (42 loc) · 1.17 KB

PCB-华为云token管理服务

Powered by Function graph of Huawei cloud

Pre

prepare the .env file in the root dictionary:

CONFIG_APPMODE=release     # app mode: release or debug
CONFIG_PORT=:8000          # server port
CONFIG_MYSQL_ADDRESS=###   # Mysql url
CONFIG_MYSQL_PORT=###      # Mysql port 
CONFIG_MYSQL_USER=###      # Mysql username
CONFIG_MYSQL_PASS=###      # Mysql password
CONFIG_MYSQL_DBNAME=###    # Mysql database name
CONFIG_HUAWEI_USER=###     # huawei cloud username
CONFIG_HUAWEI_IAMUSER=###  # IAM username
CONFIG_HUAWEI_IAMPASS=###  # IAM password

run the code

go run main.go

Build

Tutorial written by huawei

configure the linux:amd64 environment

set GOARCH=amd64
go env -w GOARCH=amd64
set GOOS=linux
go env -w GOOS=linux

build

# go build -o [目标可执行程序] [源程序]
# 
go build -o go-http-demo main.go

restore the environment configuration

set GOARCH=amd64
go env -w GOARCH=amd64
set GOOS=windows
go env -w GOOS=windows