service

package
v0.0.0-...-50815b3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayOpts

type GatewayOpts struct {
	Token string
}

GatewayOpts declares gateway configuration

type Opts

type Opts struct {
	Token string
	TLSOpts
	GatewayOpts
}

Opts declares configuration for the core service

type Service

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

Service provides core application service functionality. It handles most logic and connections to various backends. It implements an gRPC interface.

func New

func New(awsConfig client.ConfigProvider, logger *zap.SugaredLogger, opts Opts) (*Service, error)

New creates a new Service

func (*Service) CreateAccount

func (s *Service) CreateAccount(ctx context.Context, req *request.CreateAccount) (*response.Message, error)

CreateAccount registers a user and sends an email verification email

func (*Service) CreateClub

func (s *Service) CreateClub(ctx context.Context, req *request.CreateClub) (*response.Message, error)

CreateClub creates a club

func (*Service) CreateEvent

func (s *Service) CreateEvent(ctx context.Context, req *request.CreateEvent) (*response.Message, error)

CreateEvent creates a form

func (*Service) CreatePeriod

func (s *Service) CreatePeriod(ctx context.Context, req *request.CreatePeriod) (*response.Message, error)

CreatePeriod creates a period

func (*Service) GetStatus

func (s *Service) GetStatus(ctx context.Context, req *request.Status) (*response.Status, error)

GetStatus retrieves status of service

func (*Service) Handshake

func (s *Service) Handshake(ctx context.Context, req *request.Empty) (*response.Empty, error)

Handshake generates response to a Ping request (For Initial Auth Purpose)

func (*Service) Login

func (s *Service) Login(ctx context.Context, req *request.Login) (*response.Message, error)

Login looks up the given email and password and attempts to validate the user

func (*Service) Run

func (s *Service) Run(host, port string) error

Run starts up the service and blocks until exit

func (*Service) Stop

func (s *Service) Stop()

Stop releases resources and shuts down the service

func (*Service) Verify

func (s *Service) Verify(ctx context.Context, req *request.Verify) (*response.Message, error)

Verify looks up the given hash, and verifies the hash matching email

type TLSOpts

type TLSOpts struct {
	CertFile string
	KeyFile  string
}

TLSOpts defines TLS configuration

Jump to

Keyboard shortcuts

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