internal

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const YammerApiURL = "https://www.yammer.com/api/v1/"
View Source
const YammerOAuthUrl = "https://www.yammer.com/dialog/oauth"

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(clientId string) string

Authenticate authenticate a user via OAUTH2 Implicit Flow and returns the access token.

func DumpImage added in v0.3.1

func DumpImage(tmpdir string, infix string, imageData []byte) (*os.File, error)

func ElipseMe

func ElipseMe(s string, length int, pad bool) string

func FileExists

func FileExists(path string) bool

func GetToken

func GetToken() string

GetToken read an access token from a file and returns it.

func Notify

func Notify(summary, message, icon string)

func SetToken

func SetToken(clientId string)

SetToken acquires an access token and store it to a file.

func Systray_init added in v0.3.0

func Systray_init()

func Systray_poll added in v0.3.0

func Systray_poll()

func Systray_reset added in v0.3.0

func Systray_reset()

Types

type Client

type Client struct {
	Token     string
	BaseURL   *url.URL
	UserAgent string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) GetImage

func (c *Client) GetImage(url string) ([]byte, error)

type Message

type Message struct {
	YammerMessage
}

Message is the data structure to represent a set of messages.

type Messages

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

Messages is the data structure to represent all messages.

func NewMessages

func NewMessages(client *Client) *Messages

NewMessages returns a new Messages object.

func (*Messages) GetNewMessages

func (messages *Messages) GetNewMessages(groupId int64) ([]*Message, error)

GetNewMessages returns new messages for the given group (in chronological order).

type User

type User struct {
	YammerUserResponse

	Groups *YammerGroupResponse
	// contains filtered or unexported fields
}

User is the data structure to represent a single user.

type Users

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

Users is the data structure to represent all users.

func NewUsers

func NewUsers(client *Client, tmpdir string) *Users

NewUsers returns a new Users object.

func (*Users) DumpMugToFile

func (users *Users) DumpMugToFile(user *User) (*os.File, error)

func (*Users) GetMugFile

func (users *Users) GetMugFile(user *User) (*os.File, error)

func (*Users) GetUser

func (users *Users) GetUser(uid int64) (*User, error)

GetUser returns the user by id.

type YammerGroup

type YammerGroup struct {
	Type        string `json:"type"`
	ID          int64  `json:"id"`
	FullName    string `json:"full_name"`
	Description string `json:"description"`
}

type YammerGroupResponse

type YammerGroupResponse []YammerGroup

type YammerMessage

type YammerMessage struct {
	ID            int64             `json:"id"`
	SenderID      int64             `json:"sender_id"`
	RepliedToID   int64             `json:"replied_to_id"`
	CreatedAt     string            `json:"created_at"`
	SenderType    string            `json:"sender_type"`
	Body          YammerMessageBody `json:"body"`
	ThreadID      int64             `json:"thread_id"`
	ClientType    string            `json:"client_type"`
	ClientURL     string            `json:"client_url"`
	DirectMessage bool              `json:"direct_message"`
	Privacy       string            `json:"privacy"`
	WebUrl        string            `json:"web_url"`
}

type YammerMessageBody

type YammerMessageBody struct {
	Plain string `json:"plain"`
}

type YammerMessageResponse

type YammerMessageResponse struct {
	Messages []YammerMessage `json:"messages"`
	Meta     struct {
		OlderAvailable        bool        `json:"older_available"`
		RequestedPollInterval int         `json:"requested_poll_interval"`
		LastSeenMessageID     interface{} `json:"last_seen_message_id"`
		UnseenThreadCount     int         `json:"unseen_thread_count"`
		CurrentUserID         int64       `json:"current_user_id"`
		FeedName              string      `json:"feed_name"`
		FeedDesc              string      `json:"feed_desc"`
	} `json:"meta"`
}

type YammerUserResponse

type YammerUserResponse struct {
	Type              string `json:"type"`
	ID                int64  `json:"id"`
	State             string `json:"state"`
	JobTitle          string `json:"job_title"`
	Location          string `json:"location"`
	FullName          string `json:"full_name"`
	FirstName         string `json:"first_name"`
	LastName          string `json:"last_name"`
	WebURL            string `json:"web_url"`
	Name              string `json:"name"`
	MugshotURL        string `json:"mugshot_url"`
	BirthDate         string `json:"birth_date"`
	BirthDateComplete string `json:"birth_date_complete"`
	Timezone          string `json:"timezone"`
	Email             string `json:"email"`
}

Jump to

Keyboard shortcuts

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