Documentation
¶
Index ¶
- Constants
- type DB
- func (db DB) CreateSchema() error
- func (db *DB) Delete(key string) error
- func (db *DB) Get(key string) (*Toast, error)
- func (db DB) GetHyperTempl() string
- func (db DB) GetToastTempl() string
- func (db DB) New(msg string) *Toast
- func (db *DB) Save(toast *Toast) (string, error)
- func (db *DB) SetHyperTempl(tmpl string)
- func (db *DB) SetToastTempl(tmpl string)
- type MapStore
- func (ms *MapStore) Delete(key string) error
- func (ms MapStore) Get(key string) (*Toast, error)
- func (ms MapStore) GetHyperTempl() string
- func (ms MapStore) GetToastTempl() string
- func (ms MapStore) New(msg string) *Toast
- func (ms *MapStore) Save(toast *Toast) (string, error)
- func (ms *MapStore) SetHyperTempl(tmpl string)
- func (ms *MapStore) SetToastTempl(tmpl string)
- type Store
- type Toast
- func (t Toast) Render() string
- func (t Toast) RenderHyperscript() string
- func (t *Toast) SetDismissable(dis bool) *Toast
- func (t *Toast) SetErrMessage(msg error) *Toast
- func (t *Toast) SetLocation(loc ToastLocation) *Toast
- func (t *Toast) SetMessage(msg string) *Toast
- func (t *Toast) SetTitle(title string) *Toast
- func (t *Toast) SetType(tp ToastType) *Toast
- func (t *Toast) ShowIcon(icn bool) *Toast
- type ToastLocation
- type ToastType
Constants ¶
View Source
const ( LOC_TOP_LEFT ToastLocation = "top-left" LOC_TOP_CENTER ToastLocation = "top-center" LOC_TOP_RIGHT ToastLocation = "top-right" // default LOC_BOTTOM_LEFT ToastLocation = "bottom-left" LOC_BOTTOM_CENTER ToastLocation = "bottom-center" LOC_BOTTOM_RIGHT ToastLocation = "bottom-right" TYPE_SUCCESS ToastType = "success" TYPE_WARNING ToastType = "warning" TYPE_ERROR ToastType = "error" TYPE_INFO ToastType = "info" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (DB) CreateSchema ¶
func (DB) GetHyperTempl ¶ added in v0.1.3
func (DB) GetToastTempl ¶ added in v0.1.3
func (*DB) SetHyperTempl ¶ added in v0.1.3
func (*DB) SetToastTempl ¶ added in v0.1.3
type MapStore ¶
func CreateMapStore ¶
func CreateMapStore() *MapStore
func (MapStore) GetHyperTempl ¶ added in v0.1.2
func (MapStore) GetToastTempl ¶
func (*MapStore) SetHyperTempl ¶ added in v0.1.2
func (*MapStore) SetToastTempl ¶
type Toast ¶
type Toast struct {
ID string `json:"id" db:"id"`
Title string `json:"title,omitempty" db:"title"`
Message string `json:"message,omitempty" db:"message"`
Location ToastLocation `json:"location,omitempty" db:"location"`
Icon bool `json:"icon" db:"icon"`
Dismissable bool `json:"dismissable" db:"dismissable"`
Type ToastType `json:"type,omitempty" db:"msg_type"`
CreatedAt time.Time `json:"created_at" db:"-"`
CreatedAtStr string `json:"-" db:"created_at"`
ToastTemplate string `json:"-" db:"-"`
HyperscriptTemplate string `json:"-" db:"-"`
}
func (Toast) RenderHyperscript ¶
func (*Toast) SetDismissable ¶
func (*Toast) SetErrMessage ¶
func (*Toast) SetLocation ¶
func (t *Toast) SetLocation(loc ToastLocation) *Toast
func (*Toast) SetMessage ¶
type ToastLocation ¶
type ToastLocation string
Click to show internal directories.
Click to hide internal directories.