repo

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LGTMCreatedMessage

type LGTMCreatedMessage struct {
	LGTM     *models.LGTM `json:"lgtm"`
	Source   string       `json:"source"`
	ClientIP string       `json:"client_ip"`
}

type LGTMListOption

type LGTMListOption func(*lgtmListOptions)

func WithLGTMAfter

func WithLGTMAfter(l *models.LGTM) LGTMListOption

func WithLGTMCategory added in v0.4.0

func WithLGTMCategory(category, lang string) LGTMListOption

func WithLGTMLimit

func WithLGTMLimit(limit int) LGTMListOption

func WithLGTMRandom

func WithLGTMRandom() LGTMListOption

type NotificationMessage

type NotificationMessage struct {
	Type          NotificationType      `json:"type"`
	LGTMCreated   *LGTMCreatedMessage   `json:"lgtm_created"`
	ReportCreated *ReportCreatedMessage `json:"report_created"`
}

type NotificationType

type NotificationType string
const (
	NotificationTypeLGTMCreated   NotificationType = "lgtm_created"
	NotificationTypeReportCreated NotificationType = "report_created"
)

type ReportCreatedMessage

type ReportCreatedMessage struct {
	Report *models.Report `json:"report"`
}

type Repository

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

func New

func New(ctx context.Context) (*Repository, error)

func (Repository) CategorizeLGTM added in v0.4.0

func (r Repository) CategorizeLGTM(ctx context.Context) (map[string][]string, error)

func (Repository) CreateLGTM

func (r Repository) CreateLGTM(ctx context.Context, data []byte, opts ...lgtmgen.GenerateOption) (*models.LGTM, error)

func (Repository) CreateReport

func (r Repository) CreateReport(ctx context.Context, lgtmID string, t models.ReportType, text string) (*models.Report, error)

func (Repository) DeleteLGTM added in v0.3.0

func (r Repository) DeleteLGTM(ctx context.Context, id string) error

func (Repository) FindLGTM

func (r Repository) FindLGTM(ctx context.Context, id string) (*models.LGTM, error)

func (Repository) FindRate

func (r Repository) FindRate(ctx context.Context, ip, tier string) (*models.Rate, error)

func (Repository) IncrementCategoryByName added in v0.4.0

func (r Repository) IncrementCategoryByName(ctx context.Context, name string, lang string) (*models.Category, error)

func (Repository) IncrementRate

func (r Repository) IncrementRate(ctx context.Context, ip, tier string) error

func (Repository) ListCategories added in v0.4.0

func (r Repository) ListCategories(ctx context.Context, lang string) (models.Categories, error)

func (Repository) ListLGTMs

func (r Repository) ListLGTMs(ctx context.Context, opts ...LGTMListOption) (models.LGTMs, error)

func (Repository) ListNews

func (r Repository) ListNews(ctx context.Context, locale string) (models.NewsList, error)

func (Repository) NotifyLGTMCreated

func (r Repository) NotifyLGTMCreated(ctx context.Context, msg *LGTMCreatedMessage) error

func (Repository) NotifyReportCreated

func (r Repository) NotifyReportCreated(ctx context.Context, msg *ReportCreatedMessage) error

func (Repository) SearchImages

func (r Repository) SearchImages(ctx context.Context, q string) (models.Images, error)

func (Repository) SendLGTMCreatedMessage

func (r Repository) SendLGTMCreatedMessage(ctx context.Context, msg *LGTMCreatedMessage) error

func (Repository) SendReportCreatedMessage

func (r Repository) SendReportCreatedMessage(ctx context.Context, msg *ReportCreatedMessage) error

Jump to

Keyboard shortcuts

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