/supabase-storage-go

Storage util client for Supabase in Go, with extra features

Primary LanguageGo

Storage GO

Golang client for Supabase Storage API

Quick start

Install

go get github.com/supabase-community/storage-go

Usage

package main

import (
	"fmt"
	"os"

	"github.com/supabase-community/storage-go"
)

func main() {
	client := storage_go.NewClient("https://abc.supabase.co/storage/v1", "<service-token>", nil)

	// Get buckets
	fmt.Println(client.ListBuckets())

	// Upload a file

	file, err := os.Open("dummy.txt")
	if err != nil {
		panic(err)
	}

	resp := client.UploadFile("bucket-name", "file.txt", file)
	fmt.Println(resp)
}

Note to self: Update after tagging: GOPROXY=proxy.golang.org go list -m github.com/supabase-community/storage-go@v0.6.8