service

package
v0.0.0-...-9a81921 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmailVerificationSubject = "[rkus.ninja] Please verify your email address"
	PasswordResetSubject     = "[rkus.ninja] Password reset request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(svc kmsiface.KMSAPI, conf *AuthServiceConfig) *AuthService

func (*AuthService) SignJWT

func (s *AuthService) SignJWT(p *myjwt.Payload) (*myjwt.JWT, error)

func (*AuthService) ValidateJWT

func (s *AuthService) ValidateJWT(t *myjwt.JWT) (*myjwt.Payload, error)

type AuthServiceConfig

type AuthServiceConfig struct {
	KeyID string
}

type MailService

type MailService struct {
	// contains filtered or unexported fields
}

func NewMailService

func NewMailService(svc sesiface.SESAPI, conf *MailServiceConfig) *MailService

func (*MailService) SendEmailVerificationMail

func (s *MailService) SendEmailVerificationMail(
	input *SendEmailVerificationMailInput,
) error

func (*MailService) SendPasswordResetMail

func (s *MailService) SendPasswordResetMail(
	input *SendPasswordResetInput,
) error

type MailServiceConfig

type MailServiceConfig struct {
	CharSet string
	Sender  string
	RootURL string
}

type SendEmailVerificationMailInput

type SendEmailVerificationMailInput struct {
	EmailID   string
	To        string
	Token     string
	UserLogin string
}

type SendPasswordResetInput

type SendPasswordResetInput struct {
	To        string
	Token     string
	UserLogin string
}

type Services

type Services struct {
	Auth    *AuthService
	Mail    *MailService
	Storage *StorageService
}

func NewServices

func NewServices(conf *myconf.Config) (*Services, error)

type StorageService

type StorageService struct {
	// contains filtered or unexported fields
}

StorageService - service used for storing assets

func NewStorageService

func NewStorageService(conf *myconf.Config) (*StorageService, error)

NewStorageService - create a new storage service instance

func (*StorageService) Get

func (s *StorageService) Get(
	userID *mytype.OID,
	key string,
) (*minio.Object, error)

Get - get an object from passed userID, and key

func (*StorageService) GetThumbnail

func (s *StorageService) GetThumbnail(
	size int,
	userID *mytype.OID,
	key string,
) (*minio.Object, error)

GetThumbnail - get a thumbnail of an asset, and generate it first if necessary

func (*StorageService) Upload

func (s *StorageService) Upload(
	userID *mytype.OID,
	file io.Reader,
	contentType string,
	size int64,
) (*UploadResponse, error)

Upload - upload asset to storage service

type UploadResponse

type UploadResponse struct {
	Key         string
	IsNewObject bool
}

UploadResponse - response object from Upload

Jump to

Keyboard shortcuts

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