service

package
v0.0.0-...-352fc9d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key any) (interface{}, bool)
	Set(key any, value interface{})
}

type Config

type Config struct {
	Host string
}

type Persistence

type Persistence interface {
	UpsertEvent(ctx context.Context, event *model.Event) error
	GetEvent(ctx context.Context, id string) (*model.Event, error)
	GetEvents(ctx context.Context, ids []string) ([]model.Event, error)
	GetProfile(ctx context.Context, id string) (*model.Profile, error)
	DeleteEvent(ctx context.Context, id string) error
	UpsertInvitation(ctx context.Context, invitation *model.Invitation) error
	GetInvitation(ctx context.Context, id string) (*model.Invitation, error)
}

type PubSub

type PubSub interface {
	Publish(context.Context, string, any) error
	Subscribe(string, func(context.Context, string, any) error)
}

type Service

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

func New

func New(config Config, pubsub PubSub, cache Cache, persistence Persistence, logger *otelzap.Logger) *Service

func (*Service) Accept

func (s *Service) Accept(ctx context.Context, invitationID, eventID string) error

func (*Service) CheckHealth

func (s *Service) CheckHealth() error

func (*Service) CreateEvent

func (s *Service) CreateEvent(ctx context.Context, event *model.Event) (*model.Event, error)

func (*Service) DeleteEvent

func (s *Service) DeleteEvent(ctx context.Context, id string) error

func (*Service) GetEvent

func (s *Service) GetEvent(ctx context.Context, id string) (*model.Event, error)

func (*Service) GetEvents

func (s *Service) GetEvents(ctx context.Context) ([]model.Event, error)

func (*Service) Invite

func (s *Service) Invite(ctx context.Context, invitation *model.Invitation) (*model.Invitation, error)

func (*Service) UpdateEvent

func (s *Service) UpdateEvent(ctx context.Context, event *model.Event) (*model.Event, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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