项目作者: hosomi

项目描述 :
Go Image, Azure SDK for Go.
高级语言: Go
项目地址: git://github.com/hosomi/go-first-step.git
创建时间: 2020-11-08T05:41:40Z
项目社区:https://github.com/hosomi/go-first-step

开源协议:MIT License

下载


Go First Step

initial setup:

  1. PS go-first-step> go mod init hosomi/go-first-step
  2. 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.
  1. PS go-first-step> go run cmd/halfsize.go material/cat0056-051.jpg out.jpg

go run cmd/superposition.go

Superposition two images.

  1. 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.

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

setup:

  1. setx AZURE_STORAGE_ACCOUNT "devstoreaccount1"
  2. setx AZURE_STORAGE_ACCESS_KEY "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="

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