Versions in this module Expand all Collapse all v0 v0.2.0 Feb 16, 2022 Changes in this version + type Validator struct + func NewValidator() *Validator + func (v *Validator) ErrorMessageMap() map[string]string v0.1.0 Feb 13, 2022 Changes in this version + var CommitHash = "unknown" + var Name = "pingcrm-echo" + var Version = "dev" + func AuthCreateHandler(c echo.Context) error + func AuthDestroyHandler(c echo.Context) error + func AuthRequired() echo.MiddlewareFunc + func AuthStoreHandler(c echo.Context) error + func ContactsCreateHandler(c echo.Context) error + func ContactsDestroyHandler(c echo.Context) error + func ContactsEditHandler(c echo.Context) error + func ContactsIndexHandler(c echo.Context) error + func ContactsRestoreHandler(c echo.Context) error + func ContactsStoreHandler(c echo.Context) error + func ContactsUpdateHandler(c echo.Context) error + func CreateContact(ctx context.Context, db *DB, contact *Contact) error + func CreateOrganization(ctx context.Context, db *DB, org *Organization) error + func CreateUser(ctx context.Context, db *DB, user *User) error + func DashboardIndexHandler(c echo.Context) error + func ErrorHandler(err error, c echo.Context) + func ImagesShowHandler(c echo.Context) error + func IsErrNoRows(err error) bool + func LoadContactWithOrganization(ctx context.Context, db *DB, contacts ...*Contact) error + func LoadOrganizationWithContacts(ctx context.Context, db *DB, orgs ...*Organization) error + func LoadUserWithAccount(ctx context.Context, db *DB, user *User) error + func OrganizationsCreateHandler(c echo.Context) error + func OrganizationsDestroyHandler(c echo.Context) error + func OrganizationsEditHandler(c echo.Context) error + func OrganizationsIndexHandler(c echo.Context) error + func OrganizationsRestoreHandler(c echo.Context) error + func OrganizationsStoreHandler(c echo.Context) error + func OrganizationsUpdateHandler(c echo.Context) error + func ParamInt64(c echo.Context, name string, defaultVal ...int64) int64 + func RedirectIfAuthenticated() echo.MiddlewareFunc + func ReportsIndexHandler(c echo.Context) error + func RestoreContact(ctx context.Context, db *DB, id int64) error + func RestoreOrganization(ctx context.Context, db *DB, id int64) error + func RestoreUser(ctx context.Context, db *DB, id int64) error + func SessionMiddleware(secret []byte) echo.MiddlewareFunc + func SoftDeleteContact(ctx context.Context, db *DB, id int64) error + func SoftDeleteOrganization(ctx context.Context, db *DB, id int64) error + func SoftDeleteUser(ctx context.Context, db *DB, id int64) error + func UpdateContact(ctx context.Context, db *DB, contact *Contact) error + func UpdateOrganization(ctx context.Context, db *DB, org *Organization) error + func UpdateUser(ctx context.Context, db *DB, user *User) error + func UsersCreateHandler(c echo.Context) error + func UsersDestroyHandler(c echo.Context) error + func UsersEditHandler(c echo.Context) error + func UsersIndexHandler(c echo.Context) error + func UsersRestoreHandler(c echo.Context) error + func UsersStoreHandler(c echo.Context) error + func UsersUpdateHandler(c echo.Context) error + type Account struct + CreatedAt time.Time + DeleteAt *time.Time + Id int64 + Name string + UpdatedAt time.Time + func GetAccountByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (*Account, error) + func GetAccountById(ctx context.Context, db *DB, id int64) (*Account, error) + type App struct + Config *Config + DB *DB + Echo *echo.Echo + func NewApp(c *Config) (*App, error) + func (a *App) Close() + func (a *App) Start() error + type Config struct + Addr string + DataDir string + DatabaseFs embed.FS + IsDemo bool + IsDev bool + PublicFs embed.FS + Secret []byte + ViewsFs embed.FS + func NewConfig() *Config + func (c *Config) DatabasePath() string + func (c *Config) GetViteManifest() inertia.ViteManifest + func (c *Config) SchemaDDL() string + type Contact struct + AccountId int64 + Address *string + City *string + Country *string + CreatedAt time.Time + DeletedAt *time.Time + Email *string + FirstName string + Id int64 + LastName string + Organization *Organization + OrganizationId *int64 + Phone *string + PostalCode *string + Region *string + UpdatedAt time.Time + func GetContactByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (*Contact, error) + func GetContactById(ctx context.Context, db *DB, id int64) (*Contact, error) + func NewContact() *Contact + func (c *Contact) Name() string + func (c *Contact) ToMap(keys ...string) map[string]interface{} + type ContactFilters struct + AccountId int64 + Search string + Trashed string + type ContactList []*Contact + func ListContactsByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (ContactList, error) + func PaginateContactsByFilters(ctx context.Context, db *DB, p *pagination.Factory, filter *ContactFilters) (*pagination.Paginator, ContactList, error) + func (l ContactList) ByIds() map[int64]*Contact + func (l ContactList) ByOrganizationIds() map[int64]ContactList + func (l ContactList) Ids() []int64 + func (l ContactList) OrganizationIds() []int64 + func (l ContactList) ToMap(keys ...string) []map[string]interface{} + type DB struct + Path string + func NewDB(dbPath string) (*DB, error) + func (db *DB) Close() error + func (db *DB) CountContextByBuilder(ctx context.Context, builder QueryBuilder) (uint64, error) + func (db *DB) ExecContextByBuilder(ctx context.Context, builder QueryBuilder) (sql.Result, error) + func (db *DB) GetContextByBuilder(ctx context.Context, dest interface{}, builder QueryBuilder) error + func (db *DB) Init(databaseFs embed.FS) error + func (db *DB) IsNotExist() bool + func (db *DB) SelectContextByBuilder(ctx context.Context, dest interface{}, builder QueryBuilder) error + type FlashMessage struct + Error string + Success string + type Organization struct + AccountId int64 + Address *string + City *string + Contacts ContactList + Country *string + CreatedAt time.Time + DeletedAt *time.Time + Email *string + Id int64 + Name string + Phone *string + PostalCode *string + Region *string + UpdatedAt time.Time + func GetOrganizationByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (*Organization, error) + func GetOrganizationById(ctx context.Context, db *DB, id int64) (*Organization, error) + func NewOrganization() *Organization + func (o *Organization) ToMap(keys ...string) map[string]interface{} + type OrganizationFilters struct + AccountId int64 + Search string + Trashed string + type OrganizationList []*Organization + func ListOrganizationsByAccountId(ctx context.Context, db *DB, accountId int64) (OrganizationList, error) + func ListOrganizationsByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (OrganizationList, error) + func PaginateOrganizationsFilters(ctx context.Context, db *DB, p *pagination.Factory, ...) (*pagination.Paginator, OrganizationList, error) + func (l OrganizationList) ByIds() map[int64]*Organization + func (l OrganizationList) Ids() []int64 + func (l OrganizationList) ToMap(keys ...string) []map[string]interface{} + type QueryBuilder interface + ToSql func() (string, []interface{}, error) + type SessionWrapper struct + func NewSessionWrapper(c echo.Context) (*SessionWrapper, error) + func (s *SessionWrapper) Errors() (map[string]string, error) + func (s *SessionWrapper) Flash() (*FlashMessage, error) + func (s *SessionWrapper) LoginWithUserId(id int64) error + func (s *SessionWrapper) Logout() error + func (s *SessionWrapper) Set(key string, value interface{}) error + func (s *SessionWrapper) SetErrors(errs map[string]string) error + func (s *SessionWrapper) SetFlashError(msg string) error + func (s *SessionWrapper) SetFlashSuccess(msg string) error + func (s *SessionWrapper) User() (*User, error) + func (s *SessionWrapper) UserId() (int64, error) + type User struct + Account *Account + AccountId int64 + CreatedAt time.Time + DeletedAt *time.Time + Email string + EmailVerifiedAt *time.Time + FirstName string + Id int64 + LastName string + Owner bool + Password string + PhotoPath *string + RememberToken string + UpdatedAt time.Time + func GetUserByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (*User, error) + func GetUserByEmail(ctx context.Context, db *DB, email string) (*User, error) + func GetUserById(ctx context.Context, db *DB, id int64) (*User, error) + func NewUser() *User + func (u *User) IsDemoUser() bool + func (u *User) Name() string + func (u *User) SetPlainPassword(plain string) + func (u *User) ToMap(keys ...string) map[string]interface{} + func (u *User) VerifyPassword(plain string) bool + type UserFilters struct + AccountId int64 + Role string + Search string + Trashed string + type UserList []*User + func ListUsersByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (UserList, error) + func ListUsersByFilters(ctx context.Context, db *DB, filter *UserFilters) (UserList, error) + func (l UserList) Ids() []int64 + func (l UserList) ToMap(keys ...string) []map[string]interface{} + type ValidationErrors map[string]string + func (v ValidationErrors) Set(key, message string) ValidationErrors