crowd

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrowdApp

type CrowdApp struct {
	AppID       int         `db:"app_id" json:"appID"`
	Name        string      `db:"name" json:"name"`
	Username    string      `db:"username" json:"username"`
	Description null.String `db:"description" json:"description,omitempty"`
	Active      bool        `db:"active" json:"active"`
	Password    null.String `db:"password" json:"-"`
	Salt        null.String `db:"salt" json:"-"`
}

type CrowdAppStatus

type CrowdAppStatus int

CrowdAppStatus indicates the state desired for a database get of crowd apps

const (
	Any CrowdAppStatus = iota
	Inactive
	Active
)

type Repo

type Repo interface {
	GetCrowdApp(context.Context, CrowdApp) (CrowdApp, error)
	GetCrowdApps(context.Context, CrowdAppStatus) ([]CrowdApp, error)
	VerifyCrowd(context.Context, CrowdApp) (CrowdApp, error)
	AddCrowdApp(context.Context, CrowdApp) (CrowdApp, error)
	EditCrowdApp(context.Context, CrowdApp) (CrowdApp, error)
	DeleteCrowdApp(context.Context, CrowdApp) error
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store stores the dependencies

func NewCrowdRepo

func NewCrowdRepo(db *sqlx.DB) *Store

NewCrowdRepo stores our dependency

func (*Store) AddCrowdApp

func (s *Store) AddCrowdApp(ctx context.Context, c CrowdApp) (CrowdApp, error)

func (*Store) DeleteCrowdApp

func (s *Store) DeleteCrowdApp(ctx context.Context, c CrowdApp) error

func (*Store) EditCrowdApp

func (s *Store) EditCrowdApp(ctx context.Context, c CrowdApp) (CrowdApp, error)

func (*Store) GetCrowdApp

func (s *Store) GetCrowdApp(ctx context.Context, c CrowdApp) (CrowdApp, error)

func (*Store) GetCrowdApps

func (s *Store) GetCrowdApps(ctx context.Context, crowdAppStatus CrowdAppStatus) ([]CrowdApp, error)

func (*Store) VerifyCrowd

func (s *Store) VerifyCrowd(ctx context.Context, c CrowdApp) (CrowdApp, error)

VerifyCrowd will check that the password is correct with provided credentials and if verified will return the CrowdApp object returned is the user object

Directories

Path Synopsis
Package mock_crowd is a generated GoMock package.
Package mock_crowd is a generated GoMock package.

Jump to

Keyboard shortcuts

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