JohnNON / oshi

oshi is an oshi.at client.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oshi

oshi is an oshi.at api client.

Installation

go get github.com/JohnNON/oshi

Example of usage:

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)
}

About

oshi is an oshi.at client.

License:Apache License 2.0


Languages

Language:Go 99.0%Language:Makefile 1.0%