common

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBroadcast

type EventBroadcast struct {
	EventName string      `json:"event"`
	EventID   string      `json:"event_id"`
	Event     EventObject `json:"event_object"`
}

EventBroadcast defines a struct which gets published for the events. @notification:event

type EventBroadcastHandler

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

EventBroadcastHandler defines a structure type which implements the EventBroadcastSubscriber interface and the EventDistributor interface.

func NewEventBroadcastHandler

func NewEventBroadcastHandler(fn func(EventBroadcast)) *EventBroadcastHandler

NewEventBroadcastHandler returns a new instance of a EventBroadcastHandler.

func (*EventBroadcastHandler) Deliver

func (sn *EventBroadcastHandler) Deliver(name, id string, receive EventObject)

Deliver will deliver the giving events into the appropriate pipeline for subscribers.

func (*EventBroadcastHandler) Handle

func (sn *EventBroadcastHandler) Handle(receive interface{})

Handle takes the giving value and asserts the expected value to match the EventBroadcast type then passes it to the Receive method.

func (*EventBroadcastHandler) Receive

func (sn *EventBroadcastHandler) Receive(elem EventBroadcast)

Receive takes the giving value and execute it against the underline handler.

type EventBroadcastNotification

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

EventBroadcastNotification defines a structure type which must be used to receive EventBroadcast type has a event.

func NewEventBroadcastNotification

func NewEventBroadcastNotification() *EventBroadcastNotification

NewEventBroadcastNotification returns a new instance of NewEventBroadcastNotification.

func NewEventBroadcastNotificationWith

func NewEventBroadcastNotificationWith(validation func(EventBroadcast) bool) *EventBroadcastNotification

NewEventBroadcastNotificationWith returns a new instance of EventBroadcastNotification.

func (*EventBroadcastNotification) Handle

func (sn *EventBroadcastNotification) Handle(elem interface{})

Handle takes the giving value and asserts the expected value to be of the type and pass on to it's underline subscribers else ignoring the event.

func (*EventBroadcastNotification) Notify

Notify adds the given subscriber into the notification list and will await an update of a new event of the given EventBroadcast type.

func (*EventBroadcastNotification) UnNotify

UnNotify removes the given subscriber from the notification's list if found from future events.

type EventBroadcastSubscriber

type EventBroadcastSubscriber interface {
	Receive(EventBroadcast)
}

EventBroadcastSubscriber defines a interface that which is used to subscribe specifically for events EventBroadcast type.

type EventObject

type EventObject interface {
	RemoveEvent()
	Underlying() interface{}
}

EventObject defines a interface for the basic methods which events needs expose.

type Public

type Public struct {
	Path        string `toml:"path"`
	PackageName string `toml:"packageName"`
}

Public defines giving settings for the public assets folder which will be build to generate a embeddeable and servable assets package.

func (Public) Validate

func (p Public) Validate() error

Validate will validate the state of the giving fields.

type Remover

type Remover interface {
	Remove()
	Add(func())
}

Remover defines an interface which exposes a remove method.

type Settings

type Settings struct {
	App     string `toml:"app"`
	Theme   Theme  `toml:"theme"`
	Package string `toml:"package"`
	Static  Static `toml:"static"`
	Public  Public `toml:"public"`
}

Settings defines a structure which contains fields that are used to contain specific user settings for the gu build system.

func (Settings) Validate

func (s Settings) Validate() error

Validate will validate the state of the giving fields.

type Static

type Static struct {
	IndexDir      string `toml:"indexDir"`
	JSFileName    string `toml:"jsFile"`
	JSMapFileName string `toml:"jsMapFile"`
}

Static defines a configuration which details the place where static content and the html file for a driver should be located. This will mostly be used by js driver.

type Theme

type Theme struct {
	MinimumScaleCount             int     // Total scale to generate small font sizes.
	MaximumScaleCount             int     // Total scale to generate large font sizes
	MinimumHeadScaleCount         int     // Total scale to generate small font sizes.
	MaximumHeadScaleCount         int     // Total scale to generate large font sizes
	BaseFontSize                  int     // BaseFontSize for typeface using the provide BaseScale.
	SmallBorderRadius             int     // SmallBorderRadius for tiny components eg checkbox, radio buttons.
	MediumBorderRadius            int     // MediaBorderRadius for buttons, inputs, etc
	LargeBorderRadius             int     // LargeBorderRadius for components like cards, modals, etc.
	BaseScale                     float64 // BaseScale to use for generating expansion/detraction scale for font sizes.
	HeaderBaseScale               float64 // BaseScale to use for generating expansion/detraction scale for header h1-h6 tags.
	PrimaryWhite                  string
	SuccessColor                  string
	FailureColor                  string
	PrimaryColor                  string
	HoverShadow                   string
	DropShadow                    string
	BaseShadow                    string
	SecondaryColor                string
	FloatingShadow                string
	PrimaryBrandColor             string
	SecondaryBrandColor           string
	AnimationCurveDefault         string
	AnimationCurveFastOutLinearIn string
	AnimationCurveFastOutSlowIn   string
	AnimationCurveLinearOutSlowIn string
	MaterialPalettes              map[string][]string
}

Theme defines a struct whhich contains settings for generating a stylesheet of css rules.

Directories

Path Synopsis
themes

Jump to

Keyboard shortcuts

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