Documentation
¶
Index ¶
- Variables
- func Airbrake(ctx context.Context) (*gobrake.Notifier, bool)
- func CloseMongoDB(ctx context.Context) context.Context
- func CloseRedis(ctx context.Context) context.Context
- func GetHerokuRedisAddr() (addr string, password string)
- func MongoDB(ctx context.Context) (*mgo.Session, bool)
- func MongoDBName() string
- func MustMongoDB(ctx context.Context) *mgo.Session
- func MustRedis(ctx context.Context) *redis.Client
- func NewAirbrake(ctx context.Context, env string) context.Context
- func NewCloudinary(ctx context.Context) context.Context
- func OpenMongoDB(ctx context.Context) context.Context
- func OpenRedis(ctx context.Context) context.Context
- func Redis(ctx context.Context) (*redis.Client, bool)
- func WithMockMongoDB()
- type CloudinaryService
- func (c CloudinaryService) DeleteStaticImage(path string, fileName string) error
- func (c CloudinaryService) ResourceURL(fileName string) string
- func (c CloudinaryService) Resources() ([]*gocloud.Resource, error)
- func (c CloudinaryService) UploadStaticImage(path string, fileName string, data io.Reader) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFoundCloudinary not found clodinary error ErrNotFoundCloudinary = errors.New("not found cloudinary") )
Functions ¶
func CloseMongoDB ¶
CloseMongoDB closes mongoDB connections in the context's
func CloseRedis ¶
CloseRedis closes Redis connections in the context's default
func GetHerokuRedisAddr ¶
GetHerokuRedisAddr returns heroku env
func MustMongoDB ¶
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 ¶
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 ¶
NewAirbrake new airbrake client for env name
func NewCloudinary ¶
NewCloudinary new cloudinary client
func OpenMongoDB ¶
OpenMongoDB open MongoDB connections in the context's default
Types ¶
type CloudinaryService ¶
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 ¶
UploadStaticImage upload static image for image data