assets

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: AGPL-3.0 Imports: 2 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetSource added in v0.15.0

type AssetSource interface {
	Channels() ([]Channel, error)
	Fields() ([]Field, error)
	Flow(FlowUUID) (Flow, error)
	Groups() ([]Group, error)
	Labels() ([]Label, error)
	Locations() ([]LocationHierarchy, error)
	Resthooks() ([]Resthook, error)
}

AssetSource is a source of assets

type Channel added in v0.15.0

type Channel interface {
	UUID() ChannelUUID
	Name() string
	Address() string
	Schemes() []string
	Roles() []ChannelRole
	ParentUUID() ChannelUUID
	Country() string
	MatchPrefixes() []string
}

Channel is something that can send/receive messages

type ChannelRole added in v0.15.0

type ChannelRole string

ChannelRole is a role that a channel can perform

const (
	ChannelRoleSend    ChannelRole = "send"
	ChannelRoleReceive ChannelRole = "receive"
	ChannelRoleCall    ChannelRole = "call"
	ChannelRoleAnswer  ChannelRole = "answer"
	ChannelRoleUSSD    ChannelRole = "ussd"
)

different roles that channels can perform

type ChannelUUID added in v0.15.0

type ChannelUUID utils.UUID

ChannelUUID is the UUID of a channel

const NilChannelUUID ChannelUUID = ChannelUUID("")

NilChannelUUID is an empty channel UUID

type Field added in v0.15.0

type Field interface {
	Key() string
	Name() string
	Type() FieldType
}

Field is a custom contact property

type FieldType added in v0.15.0

type FieldType string

FieldType is the data type of values for each field

const (
	FieldTypeText     FieldType = "text"
	FieldTypeNumber   FieldType = "number"
	FieldTypeDatetime FieldType = "datetime"
	FieldTypeWard     FieldType = "ward"
	FieldTypeDistrict FieldType = "district"
	FieldTypeState    FieldType = "state"
)

field value types

type Flow added in v0.15.0

type Flow interface {
	UUID() FlowUUID
	Name() string
	Definition() json.RawMessage
}

Flow is graph of nodes with actions and routers

type FlowUUID added in v0.15.0

type FlowUUID utils.UUID

FlowUUID is the UUID of a flow

type Group added in v0.15.0

type Group interface {
	UUID() GroupUUID
	Name() string
	Query() string
}

Group is a set of contacts

type GroupUUID added in v0.15.0

type GroupUUID utils.UUID

GroupUUID is the UUID of a group

type Label added in v0.15.0

type Label interface {
	UUID() LabelUUID
	Name() string
}

Label is something that can be applied a message

type LabelUUID added in v0.15.0

type LabelUUID utils.UUID

LabelUUID is the UUID of a label

type LocationHierarchy added in v0.15.0

type LocationHierarchy interface {
	FindByPath(path string) *utils.Location
	FindByName(name string, level utils.LocationLevel, parent *utils.Location) []*utils.Location
}

LocationHierarchy is a searchable hierachy of locations

type Resthook added in v0.15.0

type Resthook interface {
	Slug() string
	Subscribers() []string
}

Resthook is a set of URLs which are subscribed to the named event

Directories

Path Synopsis
Package rest is an implementation of AssetSource which fetches assets from a REST server.
Package rest is an implementation of AssetSource which fetches assets from a REST server.

Jump to

Keyboard shortcuts

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