Documentation ¶
Index ¶
- Variables
- 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
- type App
- type Config
- type Contact
- type ContactFilters
- type ContactList
- type DB
- 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
- type Organization
- type OrganizationFilters
- type OrganizationList
- 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)
- type QueryBuilder
- type SessionWrapper
- 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
- type UserFilters
- type UserList
- type ValidationErrors
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Name = "pingcrm-echo" Version = "dev" // It will be overwritten by the build script CommitHash = "unknown" // It will be overwritten by the build script )
Functions ¶
func AuthCreateHandler ¶
func AuthCreateHandler(c echo.Context) error
func AuthDestroyHandler ¶
func AuthDestroyHandler(c echo.Context) error
func AuthRequired ¶
func AuthRequired() echo.MiddlewareFunc
func AuthStoreHandler ¶
func AuthStoreHandler(c echo.Context) error
func ContactsCreateHandler ¶
func ContactsCreateHandler(c echo.Context) error
func ContactsDestroyHandler ¶
func ContactsDestroyHandler(c echo.Context) error
func ContactsEditHandler ¶
func ContactsEditHandler(c echo.Context) error
func ContactsIndexHandler ¶
func ContactsIndexHandler(c echo.Context) error
func ContactsRestoreHandler ¶
func ContactsRestoreHandler(c echo.Context) error
func ContactsStoreHandler ¶
func ContactsStoreHandler(c echo.Context) error
func ContactsUpdateHandler ¶
func ContactsUpdateHandler(c echo.Context) error
func CreateOrganization ¶
func CreateOrganization(ctx context.Context, db *DB, org *Organization) error
func DashboardIndexHandler ¶
func DashboardIndexHandler(c echo.Context) error
func ErrorHandler ¶
func ErrorHandler(err error, c echo.Context)
func ImagesShowHandler ¶
func ImagesShowHandler(c echo.Context) error
func IsErrNoRows ¶
func LoadOrganizationWithContacts ¶
func LoadOrganizationWithContacts(ctx context.Context, db *DB, orgs ...*Organization) error
func OrganizationsCreateHandler ¶
func OrganizationsCreateHandler(c echo.Context) error
func OrganizationsDestroyHandler ¶
func OrganizationsDestroyHandler(c echo.Context) error
func OrganizationsEditHandler ¶
func OrganizationsEditHandler(c echo.Context) error
func OrganizationsIndexHandler ¶
func OrganizationsIndexHandler(c echo.Context) error
func OrganizationsRestoreHandler ¶
func OrganizationsRestoreHandler(c echo.Context) error
func OrganizationsStoreHandler ¶
func OrganizationsStoreHandler(c echo.Context) error
func OrganizationsUpdateHandler ¶
func OrganizationsUpdateHandler(c echo.Context) error
func ParamInt64 ¶
func RedirectIfAuthenticated ¶
func RedirectIfAuthenticated() echo.MiddlewareFunc
func ReportsIndexHandler ¶
func ReportsIndexHandler(c echo.Context) error
func SessionMiddleware ¶
func SessionMiddleware(secret []byte) echo.MiddlewareFunc
func SoftDeleteOrganization ¶
func UpdateOrganization ¶
func UpdateOrganization(ctx context.Context, db *DB, org *Organization) error
func UsersCreateHandler ¶
func UsersCreateHandler(c echo.Context) error
func UsersDestroyHandler ¶
func UsersDestroyHandler(c echo.Context) error
func UsersEditHandler ¶
func UsersEditHandler(c echo.Context) error
func UsersIndexHandler ¶
func UsersIndexHandler(c echo.Context) error
func UsersRestoreHandler ¶
func UsersRestoreHandler(c echo.Context) error
func UsersStoreHandler ¶
func UsersStoreHandler(c echo.Context) error
func UsersUpdateHandler ¶
func UsersUpdateHandler(c echo.Context) error
Types ¶
type Account ¶
type Account struct { Id int64 `db:"id"` Name string `db:"name"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeleteAt *time.Time `db:"deleted_at"` }
func GetAccountByBuilder ¶
type Config ¶
type Config struct { Addr string IsDev bool IsDemo bool Secret []byte DataDir string PublicFs embed.FS ViewsFs embed.FS DatabaseFs embed.FS }
func (*Config) DatabasePath ¶
func (*Config) GetViteManifest ¶
func (c *Config) GetViteManifest() inertia.ViteManifest
type Contact ¶
type Contact struct { Id int64 `db:"id"` AccountId int64 `db:"account_id"` OrganizationId *int64 `db:"organization_id"` FirstName string `db:"first_name"` LastName string `db:"last_name"` Email *string `db:"email"` Phone *string `db:"phone"` Address *string `db:"address"` City *string `db:"city"` Region *string `db:"region"` Country *string `db:"country"` PostalCode *string `db:"postal_code"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` Organization *Organization `db:"-"` }
func GetContactByBuilder ¶
func NewContact ¶
func NewContact() *Contact
type ContactFilters ¶
type ContactList ¶
type ContactList []*Contact
func ListContactsByBuilder ¶
func ListContactsByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (ContactList, error)
func PaginateContactsByFilters ¶
func PaginateContactsByFilters(ctx context.Context, db *DB, p *pagination.Factory, filter *ContactFilters) (*pagination.Paginator, ContactList, error)
func (ContactList) ByIds ¶
func (l ContactList) ByIds() map[int64]*Contact
func (ContactList) ByOrganizationIds ¶
func (l ContactList) ByOrganizationIds() map[int64]ContactList
func (ContactList) Ids ¶
func (l ContactList) Ids() []int64
func (ContactList) OrganizationIds ¶
func (l ContactList) OrganizationIds() []int64
func (ContactList) ToMap ¶
func (l ContactList) ToMap(keys ...string) []map[string]interface{}
type DB ¶
DB is a database client. It supports only sqlite3.
func (*DB) CountContextByBuilder ¶
func (*DB) ExecContextByBuilder ¶
func (*DB) GetContextByBuilder ¶
func (db *DB) GetContextByBuilder(ctx context.Context, dest interface{}, builder QueryBuilder) error
func (*DB) IsNotExist ¶
func (*DB) SelectContextByBuilder ¶
func (db *DB) SelectContextByBuilder(ctx context.Context, dest interface{}, builder QueryBuilder) error
type FlashMessage ¶
type Organization ¶
type Organization struct { Id int64 `db:"id"` AccountId int64 `db:"account_id"` Name string `db:"name"` Email *string `db:"email"` Phone *string `db:"phone"` Address *string `db:"address"` City *string `db:"city"` Region *string `db:"region"` Country *string `db:"country"` PostalCode *string `db:"postal_code"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` Contacts ContactList `db:"-"` }
func GetOrganizationByBuilder ¶
func GetOrganizationByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (*Organization, error)
func GetOrganizationById ¶
func NewOrganization ¶
func NewOrganization() *Organization
func (*Organization) ToMap ¶
func (o *Organization) ToMap(keys ...string) map[string]interface{}
type OrganizationFilters ¶
type OrganizationList ¶
type OrganizationList []*Organization
func ListOrganizationsByBuilder ¶
func ListOrganizationsByBuilder(ctx context.Context, db *DB, builder QueryBuilder) (OrganizationList, error)
func PaginateOrganizationsFilters ¶
func PaginateOrganizationsFilters(ctx context.Context, db *DB, p *pagination.Factory, filter *OrganizationFilters) (*pagination.Paginator, OrganizationList, error)
func (OrganizationList) ByIds ¶
func (l OrganizationList) ByIds() map[int64]*Organization
func (OrganizationList) Ids ¶
func (l OrganizationList) Ids() []int64
func (OrganizationList) ToMap ¶
func (l OrganizationList) ToMap(keys ...string) []map[string]interface{}
type QueryBuilder ¶
type SessionWrapper ¶
type SessionWrapper struct {
// contains filtered or unexported fields
}
func NewSessionWrapper ¶
func NewSessionWrapper(c echo.Context) (*SessionWrapper, error)
func (*SessionWrapper) Flash ¶
func (s *SessionWrapper) Flash() (*FlashMessage, error)
func (*SessionWrapper) LoginWithUserId ¶
func (s *SessionWrapper) LoginWithUserId(id int64) error
func (*SessionWrapper) Logout ¶
func (s *SessionWrapper) Logout() error
func (*SessionWrapper) Set ¶
func (s *SessionWrapper) Set(key string, value interface{}) error
func (*SessionWrapper) SetFlashError ¶
func (s *SessionWrapper) SetFlashError(msg string) error
func (*SessionWrapper) SetFlashSuccess ¶
func (s *SessionWrapper) SetFlashSuccess(msg string) error
func (*SessionWrapper) User ¶
func (s *SessionWrapper) User() (*User, error)
func (*SessionWrapper) UserId ¶
func (s *SessionWrapper) UserId() (int64, error)
type User ¶
type User struct { Id int64 `db:"id"` AccountId int64 `db:"account_id"` FirstName string `db:"first_name"` LastName string `db:"last_name"` Email string `db:"email"` EmailVerifiedAt *time.Time `db:"email_verified_at"` Password string `db:"password"` Owner bool `db:"owner"` PhotoPath *string `db:"photo_path"` RememberToken string `db:"remember_token"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` Account *Account `db:"-"` }
func GetUserByBuilder ¶
func (*User) IsDemoUser ¶
func (*User) SetPlainPassword ¶
func (*User) VerifyPassword ¶
type UserFilters ¶
type ValidationErrors ¶
func (ValidationErrors) Set ¶
func (v ValidationErrors) Set(key, message string) ValidationErrors
type Validator ¶ added in v0.2.0
type Validator struct {
*validation.Validator
}
func NewValidator ¶ added in v0.2.0
func NewValidator() *Validator
func (*Validator) ErrorMessageMap ¶ added in v0.2.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.