mysql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrganizationModel

type OrganizationModel struct {
	DB *gorm.DB
}

func (*OrganizationModel) AddUser

func (m *OrganizationModel) AddUser(organization *models.Organization, user *models.User) (*models.User, error)

func (*OrganizationModel) Get

func (*OrganizationModel) GetAttributes

func (m *OrganizationModel) GetAttributes(organization *models.Organization) ([]*models.OrganizationAttribute, error)

func (*OrganizationModel) GetSettings

func (m *OrganizationModel) GetSettings(organization *models.Organization) ([]*models.Setting, error)

func (*OrganizationModel) GetUsers

func (m *OrganizationModel) GetUsers(organization *models.Organization) ([]*models.User, error)

func (*OrganizationModel) Insert

func (m *OrganizationModel) Insert(user *models.User, identifier, name string) (*models.Organization, error)

func (*OrganizationModel) Update

func (m *OrganizationModel) Update(user *models.User, organization *models.Organization, name string) (*models.Organization, error)

func (*OrganizationModel) UpdateAttribute

func (m *OrganizationModel) UpdateAttribute(setting *models.Setting, val string) (*models.OrganizationAttribute, error)

func (*OrganizationModel) UpdateSetting

func (m *OrganizationModel) UpdateSetting(updateSetting *models.Setting) (*models.Setting, error)

type ServiceModel

type ServiceModel struct {
	DB *gorm.DB
}

func (*ServiceModel) Get

func (m *ServiceModel) Get(org *models.Organization, id int) (*models.Service, error)

func (*ServiceModel) Insert

func (m *ServiceModel) Insert(org *models.Organization, identifier, title, description string, attributes []*models.ServiceAttribute, status int, owner string) (int, error)

func (*ServiceModel) Latest

func (m *ServiceModel) Latest(org *models.Organization, start, limit int) ([]*models.Service, error)

func (*ServiceModel) Update

func (m *ServiceModel) Update(service *models.Service) (int, error)

type UserModel

type UserModel struct {
	DB *gorm.DB
}

func (*UserModel) Authenticate

func (m *UserModel) Authenticate(email, password string) (int, error)

func (*UserModel) ChangePassword

func (m *UserModel) ChangePassword(id int, currentPassword, newPassword string) error

ChangePassword allows easily changing a user's password

func (*UserModel) Get

func (m *UserModel) Get(id int) (*models.User, error)

func (*UserModel) GetByEmail

func (m *UserModel) GetByEmail(email string) (*models.User, error)

func (*UserModel) Insert

func (m *UserModel) Insert(name, email, password string) error

func (*UserModel) Organizations

func (m *UserModel) Organizations(user *models.User) ([]*models.Organization, error)

Organizations returns organization structs the user is a part of

Jump to

Keyboard shortcuts

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