Help us shape the future of Go! Take the 2026 Go Developer Survey

slack

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 5 Imported by: 0

README

slack

Slack API stuff for golang

Packages:

  • rtm - for using slack's Realtime Messaging API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Token string
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(token string) API

func (API) RTMConnect added in v1.0.0

func (a API) RTMConnect() (r RTMConnectInfo, err error)

func (API) UsersInfo

func (a API) UsersInfo(user string) (u UserInfo, err error)

type BasicResponse

type BasicResponse struct {
	OK          bool   `json:"ok"`
	ErrorString string `json:"error"`
}

func (*BasicResponse) Error

func (r *BasicResponse) Error() error

func (*BasicResponse) Ok

func (r *BasicResponse) Ok() bool

type Channel

type Channel struct {
	ID                 string                 `json:"id"`
	Name               string                 `json:"name"`
	IsChannel          string                 `json:"is_channel"`
	IsGroup            string                 `json:"is_group"`
	Created            int                    `json:"created"`
	Creator            string                 `json:"creator"`
	IsArchived         bool                   `json:"is_archived"`
	IsGeneral          bool                   `json:"is_general"`
	Members            []string               `json:"members"`
	Topic              Topic                  `json:"topic"`
	Purpose            Topic                  `json:"purpose"`
	IsMember           bool                   `json:"is_member"`
	LastRead           string                 `json:"last_read"`
	UnreadCount        int                    `json:"unread_count"`
	UnreadCountDisplay int                    `json:"unread_count_display"`
	Latest             map[string]interface{} `json:"latest"`
}

type RTMConnectInfo added in v1.0.0

type RTMConnectInfo struct {
	BasicResponse
	URL string `json:"url"`
}

type Response

type Response interface {
	Ok() bool
	Error() error
}

type SlackError

type SlackError struct {
	ErrorString string
}

func (SlackError) Error

func (err SlackError) Error() string

type Topic

type Topic struct {
	Value   string `json:"value"`
	Creator string `json:"creator"`
	LastSet int    `json:"last_set"`
}

type User

type User struct {
	ID                string      `json:"id"`
	Name              string      `json:"name"`
	Deleted           bool        `json"deleted"`
	Color             string      `json:"color"`
	Profile           UserProfile `json:"profile"`
	IsAdmin           bool        `json:"is_admin"`
	IsOwner           bool        `json:"is_owner"`
	IsPrimaryOwner    bool        `json:"is_primary_owner"`
	IsRestricted      bool        `json:"is_restricted"`
	IsUltraRestricted bool        `json:"is_ultra_restricted"`
	Has2FA            bool        `json:"has_2fa"`
	HasFiles          bool        `json:"has_files"`
}

type UserInfo

type UserInfo struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Delete  bool   `json:"delete"`
	Color   string `json:"color"`
	Profile struct {
		FirstName   string `json:"first_name"`
		LastName    string `json:"last_name"`
		RealName    string `json:"real_name"`
		DisplayName string `json:"display_name"`
		Email       string `json:"email"`
		Skype       string `json:"skype"`
		Phone       string `json:"phone"`
		Image24     string `json:"image_24"`
		Image32     string `json:"image_32"`
		Image48     string `json:"image_48"`
		Image72     string `json:"image_72"`
		Image192    string `json:"image_192"`
	} `json:"profile"`
	IsAdmin  bool
	IsOwner  bool
	Has2FA   bool
	HasFiles bool
}

type UserProfile

type UserProfile struct {
	DisplayName string `json:"display_name"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	RealName    string `json:"real_name"`
	Email       string `json:"email"`
	Skype       string `json:"skype"`
	Phone       string `json:"phone"`
	Image24     string `json:"image_24"`
	Image32     string `json:"image_32"`
	Image48     string `json:"image_48"`
	Image72     string `json:"image_72"`
	Image192    string `json:"image_192"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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