Skip to content

Commit

Permalink
first vertion of package
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNON committed Oct 7, 2023
1 parent 868ad8d commit 52361d9
Show file tree
Hide file tree
Showing 8 changed files with 486 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
linters:
enable-all: true
disable:
- exhaustruct
- exhaustivestruct
- ifshort
- deadcode
- maligned
- interfacer
- golint
- nosnakecase
- structcheck
- varcheck
- scopelint
- paralleltest
- depguard
linters-settings:
tagliatelle:
case:
rules:
json: snake
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY:
test:
go test ./oshi_test

.PHONY:
lint:
golangci-lint run
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# oshi
oshi is an oshi.at api client.

oshi is an [oshi.at](https://oshi.at) api client.

Installation

go get github.com/JohnNON/oshi

Example of usage:

```golang
package main

import (
"context"
"fmt"
"log"
"net/http"
"os"

"github.com/JohnNON/oshi"
)

func main() {
ctx := context.Background()

file, err := os.ReadFile("example.png")
if err != nil {
log.Fatalln(err)
}

client := oshi.NewClient(&http.Client{})

img := oshi.NewImage(file, "name_test", 5, true, false, false)

resp, err := client.Upload(ctx, img)
if err != nil {
log.Fatal(err)
}

fmt.Printf("%+v\n", resp)
}
```
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/JohnNON/oshi

go 1.21.2

require github.com/stretchr/testify v1.8.4

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading

0 comments on commit 52361d9

Please sign in to comment.