Unofficial Go client for Bunny.net's edge storage API.

ff3094f Update Go version for Github Actions

2 months ago

#5 Upload from byte array rather than file

~jamesponddotco commented on bunnystorage todo

2 months ago


Go Documentation Go Report Card builds.sr.ht status

Package bunnystorage is a simple and easy-to-use package for interacting with the Bunny.net Edge Storage API. It provides a convenient way to manage files in your storage zones.


To install bunnystorage, run:

go get git.sr.ht/~jamesponddotco/bunnystorage-go


package main

import (


func main() {
	readOnlyKey, ok := os.LookupEnv("BUNNYNET_READ_API_KEY")
	if !ok {
		log.Fatal("missing env var: BUNNYNET_READ_API_KEY")

	readWriteKey, ok := os.LookupEnv("BUNNYNET_WRITE_API_KEY")
	if !ok {
		log.Fatal("missing env var: BUNNYNET_WRITE_API_KEY")

	// Create new Config to be initialize a Client.
	cfg := &bunnystorage.Config{
		Application: &bunnystorage.Application{
			Name:    "My Application",
			Version: "1.0.0",
			Contact: "contact@example.com",
		StorageZone: "my-storage-zone",
		Key:         readWriteKey,
		ReadOnlyKey: readOnlyKey,
		Endpoint:    bunnystorage.EndpointFalkenstein,

	// Create a new Client instance with the given Config.
	client, err := bunnystorage.NewClient(cfg)
	if err != nil {

	// List files in the storage zone.
	files, _, err := client.List(context.Background(), "/")
	if err != nil {

	for _, file := range files {
		log.Printf("File: %s, Size: %d\n", file.ObjectName, file.Length)

For more examples and usage details, please check the Go reference documentation.


Anyone can help make bunnystorage better. Check out the contribution guidelines for more information.


The following resources are available:

Released under the MIT License.