golang-exercise

module
v0.0.0-...-d0adc60 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT

README

golang-exercise

00. 참고 자료

01.Hello : Hello world

  • go 빌드용 docker 실행
docker run --rm --privileged \
    -v $PWD:/go/ \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -it --name golang golang:latest /bin/bash
  • go 소스를 하나씩 빌드하면 파일명으로 실행 파일 생성
go build hello.go
./hello

99. VScode 설정

  • Remote Containers 에 접속할 때의 설정 정보는 아래 폴더에 기록됨
/Users/<user>/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/imageConfigs/

Refer

git clone https://github.com/jdegre/5GC_APIs;

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29122_NIDD.yaml -g go -o /local/out/go/t8-client

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29122_NIDD.yaml -g go-server -o /local/out/go/t8-server

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29122_NIDD.yaml -g go-gin-server -o /local/out/go/t8-gin-server

docker run --rm --privileged \
    -v $PWD/out/go/t8-server:/go/src/ \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -it --name t8-server golang-grpc /bin/bash

mkdir -p /go/src/github.com/GIT_USER_ID/GIT_REPO_ID/
ln -s /go/src/go /go/src/github.com/GIT_USER_ID/GIT_REPO_ID/go

CID=`docker ps -f name=t8-server -q`
GEN_IP=`docker inspect --format '{{.NetworkSettings.IPAddress}}' ${CID}`
export GEN_IP=172.17.0.3
curl -i -s -v -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' \
-d '{"scsAsId": "scsAsId001"}' \
http://${GEN_IP}:8080/3gpp-nidd/v1/scsAsId001/configurations


docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29522_NIDDConfigurationTrigger.yaml -g go -o /local/out/go/niddconf-client

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29522_NIDDConfigurationTrigger.yaml -g go-server -o /local/out/go/niddconf-server

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/TS29522_NIDDConfigurationTrigger.yaml -g go-gin-server -o /local/out/go/niddconf-gin-server

docker run --rm -v $PWD:/local \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -it --name openapi-generator-cli openapitools/openapi-generator-cli /bin/bash

cd /opt/openapi-generator/modules/openapi-generator-cli/target/; java -jar openapi-generator-cli.jar version

wget https://github.com/stevenchiu30801/free5gc-nssf/raw/master/openapi/openapi-generator-cli.jar 
mv openapi-generator-cli.jar openapi-generator-cli-4.0.0-SNAPSHOT.jar
java -jar openapi-generator-cli-4.0.0-SNAPSHOT.jar version

git clone https://github.com/OpenAPITools/openapi-generator
docker build -t openapi-generator-cli -f Dockerfile .

git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
./run-in-docker.sh mvn package
Go Report Card
  • install
go get github.com/gojp/goreportcard
cd $GOPATH/src/github.com/gojp/goreportcard
make install
go get github.com/gojp/goreportcard/cmd/goreportcard-cli
goreportcard-cli -v

Directories

Path Synopsis
04.learn-go-with-tests
06.go-rpc
01.helloworld/mock_helloworld
Package mock_helloworld is a generated GoMock package.
Package mock_helloworld is a generated GoMock package.
07.go-cshared
08.go-kit
09.gin
10.go-redis
11.database
12.golangbyexample
13.golang-examples
14.synapsoftQuiz

Jump to

Keyboard shortcuts

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