-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(services/minio): Move services minio back (#913)
* minio * Add badge for README * Move minio back * Move minio back * Add empty line at the end of file
- Loading branch information
1 parent
4052e6a
commit a9b2659
Showing
20 changed files
with
1,947 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "Services Test Minio" | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'services/minio/**' | ||
pull_request: | ||
paths: | ||
- 'services/minio/**' | ||
|
||
jobs: | ||
integration_test: | ||
name: "Integration Test" | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
minio: | ||
image: wktk/minio-server | ||
ports: | ||
- 9000:9000 | ||
env: | ||
MINIO_ACCESS_KEY: "minioadmin" | ||
MINIO_SECRET_KEY: "minioadmin" | ||
|
||
strategy: | ||
matrix: | ||
go: [ "1.15", "1.16" ] | ||
|
||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
env: | ||
STORAGE_MINIO_INTEGRATION_TEST: "on" | ||
STORAGE_MINIO_CREDENTIAL: "hmac:minioadmin:minioadmin" | ||
STORAGE_MINIO_NAME: "test-bucket" | ||
STORAGE_MINIO_ENDPOINT: "http:127.0.0.1:9000" | ||
working-directory: services/minio | ||
run: make integration_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage.* | ||
bin/ | ||
.idea | ||
Makefile.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](https://semver.org/). | ||
|
||
## [v0.2.0] - 2021-09-13 | ||
|
||
### Changed | ||
|
||
- ci: Enable auto merge for Dependabot | ||
- docs: Update README (#25) | ||
|
||
### Fixed | ||
|
||
- fix: Regenerate code | ||
|
||
### Upgraded | ||
|
||
- build(deps): Bump github.com/minio/minio-go/v7 from 7.0.12 to 7.0.13 (#23) | ||
|
||
## v0.1.0 - 2021-07-26 | ||
|
||
### Added | ||
|
||
- Implement MinIO Servicer, Storager, Copier, Reacher. | ||
|
||
[v0.2.0]: https://github.com/beyondstorage/go-service-minio/compare/v0.1.0...v0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
SHELL := /bin/bash | ||
|
||
-include Makefile.env | ||
|
||
.PHONY: all check format lint build test generate tidy | ||
|
||
help: | ||
@echo "Please use \`make <target>\` where <target> is one of" | ||
@echo " check to do static check" | ||
@echo " build to create bin directory and build" | ||
@echo " generate to generate code" | ||
@echo " test to run test" | ||
|
||
check: vet | ||
|
||
format: | ||
go fmt ./... | ||
|
||
vet: | ||
go vet ./... | ||
|
||
generate: | ||
@echo "generate code" | ||
go generate ./... | ||
go fmt ./... | ||
|
||
build: tidy generate check | ||
go build ./... | ||
|
||
test: | ||
go test -race -coverprofile=coverage.txt -covermode=atomic -v . | ||
go tool cover -html="coverage.txt" -o "coverage.html" | ||
|
||
integration_test: | ||
go test -race -count=1 -covermode=atomic -v ./tests | ||
|
||
tidy: | ||
go mod tidy | ||
go mod verify | ||
|
||
clean: | ||
@echo "clean generated files" | ||
find . -type f -name 'generated.go' -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export STORAGE_MINIO_INTEGRATION_TEST=on | ||
export STORAGE_MINIO_CREDENTIAL=hmac:access_key:secret_key | ||
export STORAGE_MINIO_NAME=bucketname | ||
export STORAGE_MINIO_ENDPOINT=http:host:port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[![Services Test Minio](https://github.com/beyondstorage/go-storage/actions/workflows/services-test-minio.yml/badge.svg)](https://github.com/beyondstorage/go-storage/actions/workflows/services-test-minio.yml) | ||
|
||
# minio | ||
|
||
[MinIO](https://min.io/) is an open source cloud-native high-performance object storage service. | ||
This project will use minio's native SDK to implement [go-storage](https://github.com/beyondstorage/go-storage/), | ||
enabling users to manipulate data on minio servers through a unified interface. | ||
|
||
## Install | ||
|
||
```go | ||
go get go.beyondstorage.io/services/minio | ||
``` | ||
|
||
## Usage | ||
|
||
```go | ||
import ( | ||
"log" | ||
|
||
_ "go.beyondstorage.io/services/minio" | ||
"go.beyondstorage.io/v5/services" | ||
) | ||
|
||
func main() { | ||
store, err := services.NewStoragerFromString("minio://<bucket_name>/<work_dir>?credential=hmac:<access_key>:<secret_key>&endpoint=https:<host>:<port>") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Write data from io.Reader into hello.txt | ||
n, err := store.Write("hello.txt", r, length) | ||
} | ||
``` | ||
|
||
- See more examples in [go-storage-example](https://github.com/beyondstorage/go-storage-example). | ||
- Read [more docs](https://beyondstorage.io/docs/go-storage/services/minio) about go-service-minio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
Package minio provided support for minio by go-storage. | ||
*/ | ||
package minio | ||
|
||
//go:generate go run -tags tools go.beyondstorage.io/v5/cmd/definitions service.toml |
Oops, something went wrong.