auth

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package auth provides functionality for authentication and authorization, including operations for managing application entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo interface {
	// GetApp retrieves an application by its properties.
	GetApp(ctx context.Context, app *auth.App) (*auth.App, error)

	// Create inserts a new application into the database.
	Create(ctx context.Context, app *auth.App) (uint, error)

	// ExistAppByName checks if an application with the given name exists.
	ExistAppByName(ctx context.Context, name string) (bool, error)
}

Repo defines the interface for application-related database operations.

func NewAppRepo

func NewAppRepo(db *gorm.DB, redis *redis.Manager) Repo

NewAppRepo creates a new instance of the application repository.

Parameters:

  • db: A pointer to the gorm.DB instance for database operations.
  • redis: A pointer to the redis.Manager for caching operations.

Returns:

  • Repo: An implementation of the Repo interface.

Example:

db := // initialize gorm.DB
redisManager := // initialize redis.Manager
appRepo := NewAppRepo(db, redisManager)

Jump to

Keyboard shortcuts

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