services

package
v0.0.0-...-61c80ae Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MagicService

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

func (*MagicService) CleaUp

func (s *MagicService) CleaUp()

CleaUp: Handle connection cleanup

func (*MagicService) CreateUser

func (s *MagicService) CreateUser(user dbmodels.LinuxUser) (*dbmodels.LinuxUser, error)

func (*MagicService) DeleteUser

func (s *MagicService) DeleteUser(id int64) error

func (*MagicService) GetUser

func (s *MagicService) GetUser(id int64) (*dbmodels.LinuxUser, error)

func (*MagicService) LinuxDistroCount

func (s *MagicService) LinuxDistroCount() ([]dbmodels.GetLinuxDistroCountRow, error)

LinuxDistroCount demonstrates a few more raw queries patterns

func (*MagicService) ListDistributions

func (s *MagicService) ListDistributions() ([]string, error)

ListDistributions return list of linux distributions supported

func (*MagicService) ListUsers

func (s *MagicService) ListUsers() ([]dbmodels.LinuxUser, error)

func (*MagicService) UpdateUser

func (s *MagicService) UpdateUser(user dbmodels.LinuxUser) (*dbmodels.LinuxUser, error)

type ServiceContract

type ServiceContract interface {
	ListDistributions() ([]string, error)
	ListUsers() ([]dbmodels.LinuxUser, error)
	GetUser(id int64) (*dbmodels.LinuxUser, error)
	UpdateUser(user dbmodels.LinuxUser) (*dbmodels.LinuxUser, error)
	DeleteUser(id int64) error
	CreateUser(user dbmodels.LinuxUser) (*dbmodels.LinuxUser, error)
	LinuxDistroCount() ([]dbmodels.GetLinuxDistroCountRow, error)
}

func GetServices

func GetServices() ServiceContract

func InitializeServices

func InitializeServices(dbURI string) ServiceContract

InitializeServices: initialize service and setups connection pool

Jump to

Keyboard shortcuts

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