Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

hosomi/go-first-step

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go First Step

initial setup:

PS go-first-step> go mod init hosomi/go-first-step
go: creating new go.mod: module hosomi/go-first-step

go run cmd/halfsize.go

Halve the original image and output it.

args:

  • [0] ... Original Image File Name.
  • [1] ... Output Image File Name.
PS go-first-step> go run cmd/halfsize.go material/cat0056-051.jpg out.jpg

go run cmd/superposition.go

Superposition two images.

PS go-first-step> go run cmd/superposition.go

lower image(100x100):
lower image

upper image(50x50):
upper image

output image(Starting position 25,25):
output image


go run cmd/azuresdk_blobupload.go

Upload the files to Azure Storage Blob.
(Uploading files to Azure Blob with Azure SDK for Go)

args:

  • [0] ... Upload File Name.

The container name must be created in go-test before it is run.

PS go-first-step> go run .\cmd\azuresdk_blobupload.go .\material\cat0056-051.jpg

setup:

setx AZURE_STORAGE_ACCOUNT "devstoreaccount1"
setx AZURE_STORAGE_ACCESS_KEY "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="

🔗 Azure/azure-storage-blob-go: Microsoft Azure Blob Storage Library for Go
🔗 Go 開発者向けの Azure | Microsoft Docs
🔗 Azure クイック スタート - Go を使用してオブジェクト ストレージに BLOB を作成する | Microsoft Docs
🔗 setx | Microsoft Docs


go run cmd/azuresdk_blobdownload.go

Download the files from Azure Storage Blob.

args:

  • --container ... Azure Storage Container name.
  • --file ... Azure Storage Container Blob file name.

usage: go run cmd/azuresdk_blobdownload.go --help


go run cmd/azuresdk_and_halfsize.go

Download the JPG file from the Azure Storage Blob and upload it with half the resolution.

args:

  • --container ... Azure Storage Container name.
  • --downloadFile ... Azure Storage Container Blob download file name.
  • --uploadFile ... Azure Storage Container Blob upload file name.

usage: go run cmd/azuresdk_and_halfsize.go --help

Thanks.