Skip to content

gohouse/imgbed4github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

images

the images bed repo

图床使用而已

package main

import (
	"encoding/json"
	"fmt"
	"github.com/gohouse/imgbed4github"
	"io/ioutil"
	"log"
)

var token = "token string"

func main() {
	gh := imgbed4github.NewGithub(token, "imgbed", "images")
	res,err := gh.UploadFromLocalFile("/path/to/img.jpg","img")
	if err!=nil {
		log.Println(err.Error())
		return
	}
	var resp imgbed4github.RepositoryContentResponse
	res.Bind(&resp)

	fmt.Println(*resp.Content.Name, *resp.Content.HTMLURL)
}

About

image bed for github written in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages