goroku

package module
v0.0.0-...-677aeb5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2015 License: MIT Imports: 14 Imported by: 3

README

goroku

GoDoc Circle CI

heroku library for golang

Usage

import "gopkg.in/kyokomi/goroku.v1"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFoundCloudinary not found clodinary error
	ErrNotFoundCloudinary = errors.New("not found cloudinary")
)

Functions

func Airbrake

func Airbrake(ctx context.Context) (*gobrake.Notifier, bool)

Airbrake returns the airbrake client

func CloseMongoDB

func CloseMongoDB(ctx context.Context) context.Context

CloseMongoDB closes mongoDB connections in the context's

func CloseRedis

func CloseRedis(ctx context.Context) context.Context

CloseRedis closes Redis connections in the context's default

func GetHerokuRedisAddr

func GetHerokuRedisAddr() (addr string, password string)

GetHerokuRedisAddr returns heroku env

func MongoDB

func MongoDB(ctx context.Context) (*mgo.Session, bool)

MongoDB returns the connected redis client

func MongoDBName

func MongoDBName() string

MongoDBName return mongoDB name

func MustMongoDB

func MustMongoDB(ctx context.Context) *mgo.Session

MustMongoDB Must is a helper that wraps a call to a function returning (*mgo.Session, error) and panics if the error is non-nil

func MustRedis

func MustRedis(ctx context.Context) *redis.Client

MustRedis Must is a helper that wraps a call to a function returning (*redis.Client, error) and panics if the error is non-nil

func NewAirbrake

func NewAirbrake(ctx context.Context, env string) context.Context

NewAirbrake new airbrake client for env name

func NewCloudinary

func NewCloudinary(ctx context.Context) context.Context

NewCloudinary new cloudinary client

func OpenMongoDB

func OpenMongoDB(ctx context.Context) context.Context

OpenMongoDB open MongoDB connections in the context's default

func OpenRedis

func OpenRedis(ctx context.Context) context.Context

OpenRedis open Redis connections in the context's default

func Redis

func Redis(ctx context.Context) (*redis.Client, bool)

Redis returns the connected redis client for the default name

func WithMockMongoDB

func WithMockMongoDB()

WithMockMongoDB mock mongoDB name

Types

type CloudinaryService

type CloudinaryService struct {
	*gocloud.Service
}

CloudinaryService go-cloudinary service wrapper

func Cloudinary

func Cloudinary(ctx context.Context) CloudinaryService

Cloudinary returns the cloudinary client

func (CloudinaryService) DeleteStaticImage

func (c CloudinaryService) DeleteStaticImage(path string, fileName string) error

DeleteStaticImage delete cloudinary resource for path and fileName

func (CloudinaryService) ResourceURL

func (c CloudinaryService) ResourceURL(fileName string) string

ResourceURL returns cloudinary resourceURL for fileName

func (CloudinaryService) Resources

func (c CloudinaryService) Resources() ([]*gocloud.Resource, error)

Resources returns cloudinary uploaded resources

func (CloudinaryService) UploadStaticImage

func (c CloudinaryService) UploadStaticImage(path string, fileName string, data io.Reader) error

UploadStaticImage upload static image for image data

Jump to

Keyboard shortcuts

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