data

package
v0.0.0-...-ecdd4c2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup() (*sql.DB, error)

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 (mr *MaggiRepository) UpdateDetail(detail Detail, key string, value string) (*Detail, error)

func (*MaggiRepository) UpdateProfile

func (mr *MaggiRepository) UpdateProfile(profile Profile, newName string) (Profile, error)

type Profile

type Profile struct {
	ID   int
	Name string
}

Jump to

Keyboard shortcuts

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