chat

package
v0.0.0-...-debbb99 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG   string = "DEBUG"
	INFO    string = "INFO"
	WARNING string = "WARN"
	ERROR   string = "ERROR"
	FATAL   string = "FATAL"
)

Log levels

Variables

This section is empty.

Functions

func Routes

func Routes(router *httprouter.Router, ds *store.InMemory)

Routes defines the Chat and Chat Message API routes

Types

type Chat

type Chat struct {
	CreationTime         *timestamp.Timestamp `protobuf:"bytes,1,opt,name=creation_time,proto3" json:"creation_time,omitempty"`
	UpdatedTime          *timestamp.Timestamp `protobuf:"bytes,2,opt,name=updated_time,json=update_time,proto3" json:"updated_time,omitempty"`
	Open                 bool                 `protobuf:"varint,3,opt,name=open,proto3" json:"open,omitempty"`
	Uid                  string               `protobuf:"bytes,4,opt,name=uid,json=id,proto3" json:"uid,omitempty"`
	Client               *client.Client       `protobuf:"bytes,5,opt,name=client,proto3" json:"client,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func Create

func Create(cl *client.Client) *Chat

Create takes a Client object and returns a new Chat session.

func (*Chat) Descriptor

func (*Chat) Descriptor() ([]byte, []int)

func (*Chat) GetClient

func (m *Chat) GetClient() *client.Client

func (*Chat) GetCreationTime

func (m *Chat) GetCreationTime() *timestamp.Timestamp

func (*Chat) GetOpen

func (m *Chat) GetOpen() bool

func (*Chat) GetUid

func (m *Chat) GetUid() string

func (*Chat) GetUpdatedTime

func (m *Chat) GetUpdatedTime() *timestamp.Timestamp

func (Chat) Key

func (c Chat) Key() string

Key implements the Keyer interface of the Store and returns a string used for storing the Webhook in memory.

func (Chat) MarshalJSON

func (c Chat) MarshalJSON() ([]byte, error)

MarshalJSON converts a Chat object into a JSON string returned as a byte array.

func (*Chat) ProtoMessage

func (*Chat) ProtoMessage()

func (*Chat) Reset

func (m *Chat) Reset()

func (*Chat) String

func (m *Chat) String() string

func (*Chat) UnmarshalJSON

func (c *Chat) UnmarshalJSON(data []byte) error

UnmarshalJSON converts a JSON string (as a byte array) into a Chat object.

func (*Chat) XXX_DiscardUnknown

func (m *Chat) XXX_DiscardUnknown()

func (*Chat) XXX_Marshal

func (m *Chat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Chat) XXX_Merge

func (dst *Chat) XXX_Merge(src proto.Message)

func (*Chat) XXX_Size

func (m *Chat) XXX_Size() int

func (*Chat) XXX_Unmarshal

func (m *Chat) XXX_Unmarshal(b []byte) error

type Message

type Message struct {
	Timestamp            *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Content              string               `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Author               string               `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"`
	Chat                 string               `protobuf:"bytes,4,opt,name=chat,proto3" json:"chat,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func CreateMessage

func CreateMessage() *Message

CreateMessage constructs a new `Message` with a default timestamp of now

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetAuthor

func (m *Message) GetAuthor() string

func (*Message) GetChat

func (m *Message) GetChat() string

func (*Message) GetContent

func (m *Message) GetContent() string

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() *timestamp.Timestamp

func (Message) Key

func (m Message) Key() string

Key implements the Keyer interface of the Store and returns a string used for storing the Message in memory.

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

MarshalJSON converts a Message object into a JSON string returned as a byte array

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON converts a JSON string (as a byte array) into a Message object

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (dst *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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