mock

package
v0.0.0-...-6e9cc21 Latest Latest
Warning

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

Go to latest
Published: May 6, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileService

type FileService struct {
	GenerateNameFn   func(ext string) string
	FindFileByNameFn func(ctx context.Context, name string) (*peapod.File, io.ReadCloser, error)
	CreateFileFn     func(ctx context.Context, f *peapod.File, r io.Reader) error
}

func (*FileService) CreateFile

func (s *FileService) CreateFile(ctx context.Context, f *peapod.File, r io.Reader) error

func (*FileService) FindFileByName

func (s *FileService) FindFileByName(ctx context.Context, name string) (*peapod.File, io.ReadCloser, error)

func (*FileService) GenerateName

func (s *FileService) GenerateName(ext string) string

type JobService

type JobService struct {
	CFn           func() <-chan struct{}
	CreateJobFn   func(ctx context.Context, job *peapod.Job) error
	NextJobFn     func(ctx context.Context) (*peapod.Job, error)
	CompleteJobFn func(ctx context.Context, id int, err error) error
}

JobService manages jobs in a job queue.

func (*JobService) C

func (s *JobService) C() <-chan struct{}

func (*JobService) CompleteJob

func (s *JobService) CompleteJob(ctx context.Context, id int, err error) error

func (*JobService) CreateJob

func (s *JobService) CreateJob(ctx context.Context, job *peapod.Job) error

func (*JobService) NextJob

func (s *JobService) NextJob(ctx context.Context) (*peapod.Job, error)

type PlaylistService

type PlaylistService struct {
	FindPlaylistByIDFn      func(ctx context.Context, id int) (*peapod.Playlist, error)
	FindPlaylistByTokenFn   func(ctx context.Context, token string) (*peapod.Playlist, error)
	FindPlaylistsByUserIDFn func(ctx context.Context, id int) ([]*peapod.Playlist, error)
}

func (*PlaylistService) FindPlaylistByID

func (s *PlaylistService) FindPlaylistByID(ctx context.Context, id int) (*peapod.Playlist, error)

func (*PlaylistService) FindPlaylistByToken

func (s *PlaylistService) FindPlaylistByToken(ctx context.Context, token string) (*peapod.Playlist, error)

func (*PlaylistService) FindPlaylistsByUserID

func (s *PlaylistService) FindPlaylistsByUserID(ctx context.Context, id int) ([]*peapod.Playlist, error)

type SMSService

type SMSService struct {
	SendSMSFn func(ctx context.Context, msg *peapod.SMS) error
}

func (*SMSService) SendSMS

func (s *SMSService) SendSMS(ctx context.Context, msg *peapod.SMS) error

type TrackService

type TrackService struct {
	FindTrackByIDFn func(ctx context.Context, id int) (*peapod.Track, error)
	CreateTrackFn   func(ctx context.Context, track *peapod.Track) error
}

func (*TrackService) CreateTrack

func (s *TrackService) CreateTrack(ctx context.Context, track *peapod.Track) error

func (*TrackService) FindTrackByID

func (s *TrackService) FindTrackByID(ctx context.Context, id int) (*peapod.Track, error)

type URLTrackGenerator

type URLTrackGenerator struct {
	GenerateTrackFromURLFn func(ctx context.Context, url url.URL) (*peapod.Track, io.ReadCloser, error)
}

func (*URLTrackGenerator) GenerateTrackFromURL

func (g *URLTrackGenerator) GenerateTrackFromURL(ctx context.Context, url url.URL) (*peapod.Track, io.ReadCloser, error)

type UserService

type UserService struct {
	FindUserByIDFn           func(ctx context.Context, id int) (*peapod.User, error)
	FindUserByMobileNumberFn func(ctx context.Context, mobileNumber string) (*peapod.User, error)
	CreateUserFn             func(ctx context.Context, user *peapod.User) error
}

func (*UserService) CreateUser

func (s *UserService) CreateUser(ctx context.Context, user *peapod.User) error

func (*UserService) FindUserByID

func (s *UserService) FindUserByID(ctx context.Context, id int) (*peapod.User, error)

func (*UserService) FindUserByMobileNumber

func (s *UserService) FindUserByMobileNumber(ctx context.Context, mobileNumber string) (*peapod.User, error)

Jump to

Keyboard shortcuts

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