gocloud.devgocloud.dev/blob/memblob Index | Examples | Files

package memblob

import "gocloud.dev/blob/memblob"

Package memblob provides an in-memory blob implementation. Use OpenBucket to construct a blob.Bucket.

Open URLs

For blob.Open URLs, memblob registers for the scheme "mem"; URLs start with "mem://".

The URL's Path and Host are ignored, and no query options are supported. Example:

As

memblob does not support any types for As.

Example

Code:play 

package main

import (
	"gocloud.dev/blob/memblob"
)

func main() {

	// Create an in-memory bucket.
	_ = memblob.OpenBucket(nil)

}
Example (Open)

Code:play 

package main

import (
	"context"
	"log"

	"gocloud.dev/blob"
)

func main() {
	_, err := blob.Open(context.Background(), "mem://")
	if err != nil {
		log.Fatal(err)
	}
}

Index

Examples

Functions

func OpenBucket

func OpenBucket(opts *Options) *blob.Bucket

OpenBucket creates a *blob.Bucket backed by memory.

Types

type Options

type Options struct{}

Options sets options for constructing a *blob.Bucket backed by memory.

Source Files

memblob.go

Version
v0.9.0
Published
Jan 15, 2019
Platform
darwin/amd64
Imports
13 packages
Last checked
40 minutes ago

Tools for package owners.