// NewReader creates a new io.ReadCloser to read the contents // of the object. func NewReader(ctx context.Context, bucket, name string) (io.ReadCloser, error) { c := ctx.Value(internal.Key(0)).(map[string]interface{})["http_client"].(*http.Client) resp, err := c.Get(fmt.Sprintf(templURLMedia, bucket, name)) if err != nil { return nil, err } if resp.StatusCode == http.StatusNotFound { return nil, ErrObjectNotExists } return resp.Body, nil }
func rawService(ctx context.Context) *raw.Service { return ctx.Value(internal.Key(0)).(map[string]interface{})["pubsub_service"].(*raw.Service) }
func projID(ctx context.Context) string { return ctx.Value(internal.Key(0)).(map[string]interface{})["project_id"].(string) }