datastore

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelBuild

func DelBuild(c context.Context, build *resource.Build) error

DelBuild deletes a Build in the datastore.

func GetBuild

func GetBuild(c context.Context, name, version, channel, sdk string) (*resource.Build, error)

GetBuild retrieves a specific build from the database for the matching version ID, channel and SDK.

func GetBuildLatest added in v0.0.2

func GetBuildLatest(c context.Context, name, version, channel string) (*resource.Build, error)

GetBuildLatest retrieves a specified build from the database for the matching version and channel, for the latest SDK.

func GetChannel

func GetChannel(c context.Context, channel string) (*resource.Channel, error)

GetChannel retrieves the latest SDK version in the system for the specified channel.

func GetFeed added in v0.0.3

func GetFeed(c context.Context) ([]*resource.Build, error)

GetFeed retrieves a list of recent builds.

func NewContext

func NewContext(parent context.Context, ds Datastore) context.Context

NewContext returns a Context whose Value method returns the application's data storage objects.

func PostBuild

func PostBuild(c context.Context, build *resource.Build) error

PostBuild saves a Build in the datastore.

func PutBuild

func PutBuild(c context.Context, build *resource.Build) error

PutBuild saves a Build in the datastore.

Types

type Datastore

type Datastore interface {
	// GetFeed retrieves a list of recent builds.
	GetFeed() ([]*resource.Build, error)

	// GetChannel retrieves the latest SDK version in
	// the system for the specified channel.
	GetChannel(channel string) (*resource.Channel, error)

	// GetBuild retrieves a specific build from the
	// database for the matching version ID, channel and SDK.
	GetBuild(name, version, channel, sdk string) (*resource.Build, error)

	// GetBuildLatest retrieves a specified build from
	// the database for the matching version and channel,
	// for the latest SDK.
	GetBuildLatest(name, version, channel string) (*resource.Build, error)

	// PostBuild saves a Build in the datastore.
	PostBuild(build *resource.Build) error

	// PutBuild saves a Build in the datastore.
	PutBuild(build *resource.Build) error

	// DelBuild deletes a Build in the datastore.
	DelBuild(build *resource.Build) error
}

func FromContext

func FromContext(c context.Context) Datastore

FromContext returns the sql.DB associated with this context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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