gitlabstorage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitLabStoreQuery = `` /* 222-byte string literal not displayed */

)

queries.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitLab

type GitLab struct {
	Payload        any
	ObjectKind     string
	ProjectPath    *string
	UserUsername   *string
	EventUUID      uuid.UUID
	WebhookUUID    uuid.UUID
	ProjectID      *int64
	UserID         *int64
	KafkaOffset    int64
	KafkaPartition int32
}

GitLab represents `gitlab` table model fields.

type GitLabStorage

type GitLabStorage struct {
	Logger      *slog.Logger
	Pool        storage.PGPooler
	DatabaseDSN string
}

GitLabStorage implements GitLabPingStorer interface.

func New

func New(ctx context.Context, options ...Option) (*GitLabStorage, error)

New instantiates new gitlab storage.

func (GitLabStorage) MessageStore

func (s GitLabStorage) MessageStore(ctx context.Context, message *sarama.ConsumerMessage) error

MessageStore stores received kafka message to database.

func (GitLabStorage) Ping

func (s GitLabStorage) Ping(ctx context.Context, maxRetries uint8, backoff time.Duration) error

Ping pings database and makes sure db communication is ok.

type Option

type Option func(*GitLabStorage) error

Option represents option function type.

func WithDatabaseDSN

func WithDatabaseDSN(dsn string) Option

WithDatabaseDSN sets database data source.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger sets logger.

Jump to

Keyboard shortcuts

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