gcsref

package
v0.0.0-...-ada5ac3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package gcsref provides types for referencing Google Cloud Storage buckets and objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket string

Bucket is a reference to a Cloud Storage bucket.

func (Bucket) IsValid

func (b Bucket) IsValid() bool

IsValid reports whether the bucket name is valid. Note that this check is optimized to be fast, not absolutely correct, so some bucket names that are reported valid by this function may be considered invalid by the API.

func (Bucket) Object

func (b Bucket) Object(name string) Object

Object returns a reference for an object inside the bucket.

func (Bucket) String

func (b Bucket) String() string

String returns the bucket name.

type Object

type Object struct {
	Name   string
	Bucket Bucket
}

Object is a reference to a Cloud Storage object.

func MustParse

func MustParse(uri string) Object

MustParse parses a "gs://" URI into an object reference or panics.

func Parse

func Parse(uri string) (Object, error)

Parse parses a "gs://" URI into an object reference.

func (Object) DownloadURL

func (o Object) DownloadURL() *url.URL

DownloadURL returns the URL for downloading the object over HTTP.

func (Object) IsValid

func (o Object) IsValid() bool

IsValid reports whether the object name is valid.

func (Object) String

func (o Object) String() string

String returns the object as a "gs://" URI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL