spark

package
v0.0.0-...-a20c8b9 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a spark client

func NewClient

func NewClient(accessToken string) *Client

NewClient creates and returns a Client instance.

func (*Client) FindRoomByName

func (c *Client) FindRoomByName(roomName string) (*Room, error)

FindRoomByName returns a spark room with specified name

func (*Client) PostFileMessage

func (c *Client) PostFileMessage(msg *Message) error

PostFileMessage posts a message with attachment to spark

func (*Client) PostMessage

func (c *Client) PostMessage(msg *Message) error

PostMessage posts a message to spark

type Message

type Message struct {
	RoomId        string `json:"roomId,omitempty"`
	ToPersonEmail string `json:"toPersonEmail,omitempty"`
	Text          string `json:"text,omitempty"`
	Markdown      string `json:"markdown,omitempty"`
	Files         string `json:"files,omitempty"`
}

Message represents a spark message

type Room

type Room struct {
	Id           string    `json:"id"`
	Title        string    `json:"title"`
	Type         string    `json:"type"`
	IsLocked     bool      `json:"isLocked"`
	TeamId       string    `json:"teamId,omitempty"`
	CreatorId    string    `json:"creatorId"`
	Created      time.Time `json:"created"`
	LastActivity time.Time `json:"lastActivity"`
}

Room represents a spark room

type Rooms

type Rooms struct {
	Items []Room `json:"items"`
}

Rooms represents a spark room list

Jump to

Keyboard shortcuts

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