Skip to content

gender-equality-community/types

Repository files navigation

Security Rating Maintainability Rating Reliability Rating Code Smells Technical Debt Vulnerabilities Bugs FOSSA Status GoDoc Go Report Card

types

types holds common data structures used across GEC components.

Types

type Message

type Message struct { ... }

Message is, simply, the message to be passed between recipients

func (Message) GetTimestamp

func (m Message) GetTimestamp() time.Time

func (Message) Map

func (m Message) Map() (o map[string]any)

Map returns a map from the message to be placed on a redis XSTREAM (etc.)

type Source

type Source uint8

Source signifies the source of a message; whether it's come in from whatsapp, slack, some kind of auto-responder, or just completely unknown

Constants

const (
    // SourceUnknown is where we simply ust don't know where a message comes from,
    // and is largely only used for zero'd messages, or when errors stop the
    // processing of messages.
    SourceUnknown Source = iota

    // SourceWhatsapp means a message has come from WhatsApp and usually signifies
    // a message from someone seeking advice
    SourceWhatsapp

    // SourceAutoresponse means a message was generated from an application in the
    // processing pipeline somewhere, like the various autoresponses the gec-bot
    // provides
    SourceAutoresponse

    // SourceSlack usually means a message from the GEC _back_ to recipients; though
    // in the future perhaps we'd want to allow slack users to message too...
    // dunno
    SourceSlack
)

Readme created from Go doc with goreadme