invite

package
v0.0.0-...-4347b6b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invite

type Invite struct {
	Deleted   bool
	ID        uint64
	Key       string
	UserID    uint64
	Value     string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Invite is a loose promise to create a conection if the person assoicated with the social id key-value signs up.

type List

type List []*Invite

List is a collection of Invite.

type QueryOptions

type QueryOptions struct {
	Before  time.Time
	Deleted *bool
	IDs     []uint64
	Keys    []string
	Limit   uint
	UserIDs []uint64
	Values  []string
}

QueryOptions to narrow-down Invite queries.

type Service

type Service interface {
	service.Lifecycle

	Put(namespace string, i *Invite) (*Invite, error)
	Query(namespace string, opts QueryOptions) (List, error)
}

Service for Invite interactions.

func PostgresService

func PostgresService(db *sqlx.DB) Service

PostgresService returns a Postgres based Service implementation.

type ServiceMiddleware

type ServiceMiddleware func(Service) Service

ServiceMiddleware is a chainable behaviour modifier for Service.

func InstrumentServiceMiddleware

func InstrumentServiceMiddleware(
	component, store string,
	errCount kitmetrics.Counter,
	opCount kitmetrics.Counter,
	opLatency *prometheus.HistogramVec,
) ServiceMiddleware

InstrumentServiceMiddleware observes key apsects of Service operations and exposes Prometheus metrics.

func LogServiceMiddleware

func LogServiceMiddleware(logger log.Logger, store string) ServiceMiddleware

LogServiceMiddleware given a logger wraps the next Service with logging capabilities.

Jump to

Keyboard shortcuts

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