Documentation ¶
Index ¶
- func CORSMiddleware() gin.HandlerFunc
- func FindUser(key string, value string) (model.User, error)
- func Graph() map[string]interface{}
- func Login(c *gin.Context) string
- func NewHandler(c *Config)
- func SaveUser(username string, email string, encodedPass string, fullname string, ...) error
- func SendToQueue(body []byte)
- func SignUp(c *gin.Context) (string, error)
- func Today() int
- func Total() int
- func ValidateMongoConnection()
- func ValidateRabbitMQConnection() bool
- type Config
- type Handler
- func (h *Handler) HandleLoadState(c *gin.Context)
- func (h *Handler) HandleLogin(c *gin.Context)
- func (h *Handler) HandlePing(c *gin.Context)
- func (h *Handler) HandlePublish(c *gin.Context)
- func (h *Handler) HandleSignup(c *gin.Context)
- func (h *Handler) HandleStatistic(c *gin.Context)
- func (h *Handler) Healthz(c *gin.Context)
- func (h *Handler) Livez(c *gin.Context)
- func (h *Handler) Readyz(c *gin.Context)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(c *Config)
NewHandler initializes the handler with required injected services along with http routes Does not return as it deals directly with a reference to the gin Engine
func SaveUser ¶
func SaveUser(username string, email string, encodedPass string, fullname string, department string, role string) error
SaveUser writes a new user information to collection
func ValidateMongoConnection ¶
func ValidateMongoConnection()
ValidateMongoConnection makes sure that the connection to Mongo works
func ValidateRabbitMQConnection ¶
func ValidateRabbitMQConnection() bool
ValidateRabbitMQConnection makes a connection to RabbitMQ
Types ¶
type Config ¶
Config will hold services that will eventually be injected into this handler layer on handler initialization
type Handler ¶
type Handler struct{}
Handler struct holds required services for handler to function
func (*Handler) HandleLoadState ¶
HandleLoadState returns all stored data in DB
func (*Handler) HandleLogin ¶
HandleLogin authenticates users
func (*Handler) HandlePublish ¶
HandlePublish handles incoming requests
func (*Handler) HandleSignup ¶
HandleSignup authenticates users
func (*Handler) HandleStatistic ¶
HandleStatistic handles today's
type State ¶
type State struct { ID primitive.ObjectID `bson:"_id" json:"id,omitempty"` Image string `bson:"image" json:"image,omitempty"` OldTag string `bson:"oldtag" json:"oldtag,omitempty"` NewTag string `bson:"newtag" json:"newtag,omitempty"` Cluster string `bson:"cluster" json:"cluster,omitempty"` BlobName string `bson:"blob" json:"blob,omitempty"` Time string `bson:"time" json:"time,omitempty"` Status string `bson:"status" json:"status,omitempty"` Metadata string `bson:"metadata" json:"metadata,omitempty"` }
State structs deployment status