common

package
v0.42.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// those vars are used during the build --- linker (ld) bakes the values in
	AppVersion     string
	AppPepper      string
	VapidPublicKey string
)

Functions

func FetchData added in v0.42.0

func FetchData(input *CallInput, output *Response) bool

ng-func

func LoadUser added in v0.41.8

func LoadUser(encoded string, user *models.User) error

func ReadFile added in v0.41.2

func ReadFile(file app.Value) (data []byte, err error)

func SaveUser added in v0.41.8

func SaveUser(plain *string, user *models.User) error

Types

type CallInput

type CallInput struct {
	Method      string
	Url         string
	CallerID    string
	PageNo      int
	HideReplies bool

	// payload body for the API call
	Data interface{}
}

type Response added in v0.42.0

type Response struct {
	Code      int
	Message   string      `json:"message"`
	Timestamp int64       `json:"timestamp"`
	Data      interface{} `json:"data"`
}

standardized common response from API

type Toast added in v0.41.1

type Toast struct {
	AppContext *app.Context
	TLink      string
	TText      string
	TType      string
}

func (*Toast) Context added in v0.41.1

func (t *Toast) Context(ctx *app.Context) *Toast

func (*Toast) Dispatch added in v0.41.1

func (t *Toast) Dispatch(c interface{}, f func(*Toast, interface{}))
func (t *Toast) Link(link string) *Toast

func (*Toast) Text added in v0.41.1

func (t *Toast) Text(text string) *Toast

func (*Toast) Type added in v0.41.1

func (t *Toast) Type(typ string) *Toast

type ToastInterface added in v0.41.1

type ToastInterface interface {
	Dispatch() func(interface{})
	False() func(interface{})
}

Jump to

Keyboard shortcuts

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