event

package
v0.0.0-...-b394ddd Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(api *operations.TutorAPI, db *ent.Client)

Init sets event route handlers.

Types

type Service

type Service struct {
	Event *ent.EventClient
}

Service holds an ent event client.

func (*Service) CreateEvent

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

CreateEvent returns a new created event or an error.

func (*Service) DeleteEventByID

func (s *Service) DeleteEventByID(ctx context.Context, id uuid.UUID) error

DeleteEventByID returns an error.

func (*Service) ListEvent

func (s *Service) ListEvent(ctx context.Context, start, end *string) ([]*ent.Event, error)

ListEvent returns an event list with category, or an error.

func (*Service) ListEventUsersByID

func (s *Service) ListEventUsersByID(ctx context.Context, id uuid.UUID) ([]*ent.User, error)

ListEventUsersByID returns a list of subscribed users to an event or an error.

func (*Service) ListEventWithUsers

func (s *Service) ListEventWithUsers(ctx context.Context, start, end *string) ([]*ent.Event, error)

ListEventWithUsers returns an event list with category and users, or an error.

func (*Service) ReadEventByID

func (s *Service) ReadEventByID(ctx context.Context, id uuid.UUID) (*ent.Event, error)

ReadEventByID returns an event or an error.

func (*Service) ReadEventTypeByID

func (s *Service) ReadEventTypeByID(ctx context.Context, id uuid.UUID) (*ent.EventType, error)

ReadEventTypeByID returns the type of an event or an error.

func (*Service) UpdateEventByID

func (s *Service) UpdateEventByID(ctx context.Context, id uuid.UUID, event *ent.Event) (*ent.Event, error)

UpdateEventByID returns an existing updated event or an error.

func (*Service) UpdateEventTypeByID

func (s *Service) UpdateEventTypeByID(ctx context.Context, eventID uuid.UUID, typeID uuid.UUID) (*ent.Event, error)

UpdateEventTypeByID returns an event with type updated or an error.

Jump to

Keyboard shortcuts

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