flash

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package flash implements flash messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flash

type Flash struct {
	// contains filtered or unexported fields
}

Flash is a collection of data that is discarded on read. It's designed to be compatible with sessions.Values.

func New

func New(values map[interface{}]interface{}) *Flash

New creates a new flash handler.

func (*Flash) Alert

func (f *Flash) Alert(msg string, vars ...interface{})

Alert adds a new alert to the upcoming flash instance.

func (*Flash) Alerts

func (f *Flash) Alerts() []string

Alerts returns the list of alerts in flash, if any.

func (*Flash) Clear

func (f *Flash) Clear()

Clear removes all items from the flash. It's rare to call Clear since flashes are cleared automatically upon reading.

func (*Flash) Clone added in v0.19.0

func (f *Flash) Clone(values map[interface{}]interface{})

Clone makes a copy of this flash data into the new target.

func (*Flash) Error

func (f *Flash) Error(msg string, vars ...interface{})

Error adds a new error to the upcoming flash instance.

func (*Flash) Errors

func (f *Flash) Errors() []string

Errors returns the list of errors in flash, if any.

func (*Flash) Warning added in v0.3.0

func (f *Flash) Warning(msg string, vars ...interface{})

Warning adds a new alert to the upcoming flash instance.

func (*Flash) Warnings added in v0.3.0

func (f *Flash) Warnings() []string

Warnings returns the list of warnings in flash, if any.

Jump to

Keyboard shortcuts

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