Documentation ¶
Index ¶
- func Setup() (*sql.DB, error)
- type Detail
- type DetailType
- type MaggiRepository
- func (mr *MaggiRepository) AddDetail(key string, value string, detailType DetailType, profileID int) (*Detail, error)
- func (mr *MaggiRepository) AddProfile(name string) (Profile, error)
- func (mr *MaggiRepository) DeleteDetail(detail Detail) error
- func (mr *MaggiRepository) DeleteProfile(profile Profile) error
- func (mr *MaggiRepository) GetAllDetails(profileId int) ([]Detail, error)
- func (mr *MaggiRepository) GetAllProfiles() ([]Profile, error)
- func (mr *MaggiRepository) GetDetailsByProfileName(profileName string) ([]Detail, error)
- func (mr *MaggiRepository) UpdateDetail(detail Detail, key string, value string) (*Detail, error)
- func (mr *MaggiRepository) UpdateProfile(profile Profile, newName string) (Profile, error)
- type Profile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Detail ¶
type Detail struct { ID int Key string Value string DetailType DetailType ProfileID int }
type DetailType ¶
type DetailType string
const ( AliasDetail DetailType = "alias" EnvDetail DetailType = "env" )
func (DetailType) String ¶
func (d DetailType) String() string
type MaggiRepository ¶
type MaggiRepository struct {
// contains filtered or unexported fields
}
func NewMaggiRepository ¶
func NewMaggiRepository(db *sql.DB) *MaggiRepository
func (*MaggiRepository) AddDetail ¶
func (mr *MaggiRepository) AddDetail(key string, value string, detailType DetailType, profileID int) (*Detail, error)
func (*MaggiRepository) AddProfile ¶
func (mr *MaggiRepository) AddProfile(name string) (Profile, error)
func (*MaggiRepository) DeleteDetail ¶
func (mr *MaggiRepository) DeleteDetail(detail Detail) error
func (*MaggiRepository) DeleteProfile ¶
func (mr *MaggiRepository) DeleteProfile(profile Profile) error
func (*MaggiRepository) GetAllDetails ¶
func (mr *MaggiRepository) GetAllDetails(profileId int) ([]Detail, error)
func (*MaggiRepository) GetAllProfiles ¶
func (mr *MaggiRepository) GetAllProfiles() ([]Profile, error)
func (*MaggiRepository) GetDetailsByProfileName ¶
func (mr *MaggiRepository) GetDetailsByProfileName(profileName string) ([]Detail, error)
func (*MaggiRepository) UpdateDetail ¶
func (*MaggiRepository) UpdateProfile ¶
func (mr *MaggiRepository) UpdateProfile(profile Profile, newName string) (Profile, error)
Click to show internal directories.
Click to hide internal directories.