tenant

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Server implements the API router and handlers.

func New

func New(conf config.Config) (s *Server, err error)

func (*Server) AppDetail

func (s *Server) AppDetail(c *gin.Context)

func (*Server) AppList

func (s *Server) AppList(c *gin.Context)

func (*Server) Available

func (s *Server) Available() gin.HandlerFunc

Available is middleware that uses healthy boolean to return a service unavailable http status code if the server is shutting down or in maintenance mode. This middleware must be fairly early on in the chain to ensure that complex handling does not slow the shutdown of the server.

func (*Server) Healthy

func (s *Server) Healthy() bool

func (*Server) Serve

func (s *Server) Serve() (err error)

Serves API requests while listening on the specified bind address.

func (*Server) SetHealth

func (s *Server) SetHealth(health bool)

func (*Server) SetURL

func (s *Server) SetURL(url string)

func (*Server) Shutdown

func (s *Server) Shutdown() (err error)

Shuts down the server gracefully

func (*Server) SignUp

func (s *Server) SignUp(c *gin.Context)

Signs up a contact to receive notifications from SendGrid by making a request to the SendGrid add contacts marketing API. The SendGrid API is asynchronous, which means that it doesn't return success if the user is registered. Instead a job ID is returned and the endpoint has to check if the registration was actually successful or not. To not block this endpoint, sign up doesn't check success but returns ok if the registration was correctly submitted.

TODO: check for when the user is successfully signed up then send a welcome email. TODO: move all sendgrid-specific functionality into its own helper package. TODO: search for ensign list ID rather than configuring it externally.

func (*Server) Status

func (s *Server) Status(c *gin.Context)

Status handler returns the current health status of the server

func (*Server) TopicDetail

func (s *Server) TopicDetail(c *gin.Context)

func (*Server) TopicList

func (s *Server) TopicList(c *gin.Context)

func (*Server) URL

func (s *Server) URL() string

func (*Server) UserCreate

func (s *Server) UserCreate(c *gin.Context)

func (*Server) UserDetail

func (s *Server) UserDetail(c *gin.Context)

func (*Server) UserList

func (s *Server) UserList(c *gin.Context)

Directories

Path Synopsis
api
v1

Jump to

Keyboard shortcuts

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