user

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = fx.Options(
	fx.Module(
		module,
		fx.Decorate(
			func(l logger.Logger) logger.Logger {
				return l.WithScope(module)
			},
		),

		fx.Provide(
			fx.Private,
			fx.Annotate(
				storage.New,
				fx.As(new(service.Storage)),
			),
			fx.Annotate(
				sso.New,
				fx.As(new(service.SsoRepository)),
			),
			fx.Annotate(
				mongorepo.New,
				fx.As(new(service.DbRepository)),
			),
		),

		fx.Provide(
			fx.Annotate(service.New,
				fx.As(new(userv1.UserServiceServer)),
			),
		),

		fx.Invoke(func(lc fx.Lifecycle, storage service.Storage) {
			lc.Append(fx.Hook{
				OnStart: func(context.Context) error {
					exists, err := storage.BucketExists(context.Background(), "avatars")
					if err != nil {
						return err
					}
					if exists {
						return nil
					}

					err = storage.CreateBucket(context.Background(), "avatars")
					if err != nil {
						return err
					}

					err = storage.MakeBucketPublic(context.Background(), "avatars")
					if err != nil {
						return err
					}
					return nil
				},
				OnStop: nil,
			})
		}),
	),
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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