app

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("app",

	fx.Provide(func(conn IAMClient) iam.IAMClient {
		return iam.NewIAMClient(conn)
	}),

	domain.Module,

	fx.Invoke(
		func(server httpServer.Server, d domain.Domain, env *env.Env,
			logr logging.Logger,
			sessionRepo kv.Repo[*common.AuthSession],
		) {
			a := server.Raw()

			a.Use(httpServer.NewReadSessionMiddleware(sessionRepo, constants.CookieName, constants.CacheSessionPrefix))

			a.Use("/ws", func(c *fiber.Ctx) error {
				if websocket.IsWebSocketUpgrade(c) {
					return c.Next()
				}
				return fiber.ErrUpgradeRequired
			})

			a.Use("/ws", func(c *fiber.Ctx) error {
				ctx := c.Context()

				return websocket.New(func(sockConn *websocket.Conn) {
					if err := d.HandleWebSocket(ctx, sockConn); err != nil {
						logr.Errorf(err, "while handling websocket for resource update")
					}
				})(c)
			})

			a.Get("/healthy", func(c *fiber.Ctx) error {
				return c.SendString("OK")
			})

			a.All("*", func(c *fiber.Ctx) error {
				return c.SendStatus(fiber.StatusNotFound)
			})
		},
	),
)

Functions

This section is empty.

Types

type AuthCacheClient

type AuthCacheClient kv.Client

type AuthClient

type AuthClient grpc.Client

type ContainerRegistryClient

type ContainerRegistryClient grpc.Client

type IAMClient

type IAMClient grpc.Client

Jump to

Keyboard shortcuts

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