api

package
v0.0.0-...-8f10258 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContributionSummaryAll = "ALL_TIME"
View Source
const ContributionSummaryMonth = "THIS_MONTH"

Contribution Summary Rules

View Source
const ContributionSummaryStream = "THIS_STREAM"
View Source
const DefaultURL = "https://graphigo.prd.dlive.tv/"

DefaultURL is the url used by a API client if none is given

View Source
const DefaultURLWebsocket = "wss://graphigostream.prd.dlive.tv/"
View Source
const RoomRoleMember = "Member"
View Source
const RoomRoleModerator = "Moderator"
View Source
const RoomRoleOwner = "Owner"

Room Roles

View Source
const SortAlpha = "AZ"

Sorting

View Source
const SortTrending = "Trending"

Variables

This section is empty.

Functions

func AddModeratorMutation

func AddModeratorMutation() string

AddModeratorMutation returns the graphql mutation for setting a user in a streamer's chat as a moderator

func AllowedActionsQuery

func AllowedActionsQuery() string

AllowedActionsQuery returns the graphql query for getting a list of actions one user may take upon another on a given streamer's page

func BanStreamChatUserMutation

func BanStreamChatUserMutation() string

BanStreamChatUserMutation returns the graphql mutation for banning a user from a streamer's chat Couldn't get in dev console, is based on UnbanStreamChatUserMutation

func BrowsePageSearchCategoriesQuery

func BrowsePageSearchCategoriesQuery() string

BrowsePageSearchCategoriesQuery returns the graphql query to get all the categories you can filter on while browsing streams

func DeleteChatMutation

func DeleteChatMutation() string

DeleteChatMutation returns the graphql mutation for deleting a message from a streamer's chat

func DeleteLastBroadcastMutation

func DeleteLastBroadcastMutation() string

DeleteLastBroadcastMutation returns the graphql mutation for deleting a stream replay

func EmoteDeleteMutation

func EmoteDeleteMutation() string

EmoteDeleteMutation returns the graphql mutation for removing a sticker from the list of saved stickers for the logged in user

func EmoteSaveMutation

func EmoteSaveMutation() string

EmoteSaveMutation returns the graphql mutation for saving a sticker emote for the logged in user

func FollowUserMutation

func FollowUserMutation() string

FollowUserMutation returns the graphql mutation for becoming a follower of a streamer

func FollowingPageLivestreamsQuery

func FollowingPageLivestreamsQuery() string

FollowingPageLivestreamsQuery returns the graphql query to get the streamers the currently authenticated user is following

func FollowingPageVideosQuery

func FollowingPageVideosQuery() string

FollowingPageVideosQuery returns the graphql query for getting videos uploaded by users the authenticated user is following

func GenerateStreamKeyMutation

func GenerateStreamKeyMutation() string

GenerateStreamKeyMutation returns the graphql mutation for generating the key needed to stream data to a livestream profile

func GlobalInformationQuery

func GlobalInformationQuery() string

GlobalInformationQuery returns the graphql query string for retrieving global information about Dlive

func HomePageCarouselsQuery

func HomePageCarouselsQuery() string

HomePageCarouselsQuery returns the graphql query to get data used to populate the home page stream carousels

func HomePageCategoriesQuery

func HomePageCategoriesQuery() string

HomePageCategoriesQuery gives the graphql query to get data about the available stream categories

func HomePageLeaderboardQuery

func HomePageLeaderboardQuery() string

HomePageLeaderboardQuery gives the graphql query to get data about the streamers with the biggest gains in LINO

func HomePageLivestreamQuery

func HomePageLivestreamQuery() string

HomePageLivestreamQuery gives the graphql query to get data about the live streams that would be shown on the homepage

func LivestreamChatRoomInfoQuery

func LivestreamChatRoomInfoQuery() string

LivestreamChatRoomInfoQuery gives the graphql query to get data related to the chat of a livestream page

func LivestreamLanguagesQuery

func LivestreamLanguagesQuery() string

LivestreamLanguagesQuery returns the graphql query to get data about the available languages to set a stream to

func LivestreamPageQuery

func LivestreamPageQuery() string

LivestreamPageQuery gives the graphql query for obtaining data about a user's livestream

func LivestreamPageRefetchQuery

func LivestreamPageRefetchQuery() string

LivestreamPageRefetchQuery gives the graphql query refreshing data about a specific streamer's page

func LivestreamProfileFollowersQuery

func LivestreamProfileFollowersQuery() string

LivestreamProfileFollowersQuery returns the graphql query for getting a streamer's followers

func LivestreamProfileFollowingQuery

func LivestreamProfileFollowingQuery() string

LivestreamProfileFollowingQuery returns the graphql query for getting the users a streamer follows

func LivestreamProfileReplayQuery

func LivestreamProfileReplayQuery() string

LivestreamProfileReplayQuery returns the graphql query for getting the replays of a specified streamer

func LivestreamProfileVideoQuery

func LivestreamProfileVideoQuery() string

LivestreamProfileVideoQuery returns the graphql query for getting the videos of a specified streamer

func LivestreamProfileWalletQuery

func LivestreamProfileWalletQuery() string

LivestreamProfileWalletQuery returns the graphql query for getting balance, earnings, and transactions of a streamer

func LoginWithWalletMutation

func LoginWithWalletMutation() string

LoginWithWalletMutation returns the graphql mutation for logging with a LINO wallet account

func MeBalanceQuery

func MeBalanceQuery() string

MeBalanceQuery gives the graphql query to obtain information about authenticated user's balance

func MeDashboardQuery

func MeDashboardQuery() string

MeDashboardQuery gives the graphql query to obtain information about the authenticated user's dashboard (settings, stats, chatroom)

func MeGlobalQuery

func MeGlobalQuery() string

MeGlobalQuery returns the graphql query for retrieving about the current user

func MeLivestreamQuery

func MeLivestreamQuery() string

MeLivestreamQuery provides the graphql query for obtaining data related to the current user's livestream

func MePartnerProgressQuery

func MePartnerProgressQuery() string

MePartnerProgressQuery returns the graphql query to get information about the currently authenticated user's partner progress

func MeSubscribingQuery

func MeSubscribingQuery() string

MeSubscribingQuery returns the graphql query to get the list of users the currently authenticated user is subbed to

func RemoveModeratorMutation

func RemoveModeratorMutation() string

RemoveModeratorMutation returns the graphql mutation for removing a user as a moderator in the given streamer's chat

func SearchPageQuery

func SearchPageQuery() string

SearchPageQuery returns the graphql query for searching streamers, active streams, and videos for a specific term

func SendStreamChatMessageMutation

func SendStreamChatMessageMutation() string

SendStreamChatMessageMutation returns the graphql mutation for sending a message to a streamer's chat

func SetAllowStickerMutation

func SetAllowStickerMutation() string

SetAllowStickerMutation returns the graphql mutation for enabling or disabling stickers in a streamer's chat

func SetChatIntervalMutation

func SetChatIntervalMutation() string

SetChatIntervalMutation returns the graphql mutation for setting the how often viewers can send messages to a streamer's chat

func SetStreamTemplateMutation

func SetStreamTemplateMutation() string

SetStreamTemplateMutation returns the graphql mutation for saving a user's stream metadata

func StreamChatBannedUsersQuery

func StreamChatBannedUsersQuery() string

StreamChatBannedUsersQuery returns the graphql query for getting a list of users banned in a specific streamer's chat

func StreamChatModeratorsQuery

func StreamChatModeratorsQuery() string

StreamChatModeratorsQuery returns the graphql query for getting a list of users that are moderators in a specific streamer's chat

func StreamDonateMutation

func StreamDonateMutation() string

StreamDonateMutation returns the graphql mutation for donating LINO to a streamer

func StreamMessageSubscription

func StreamMessageSubscription() string

StreamMessageSubscription gives the graphql query to establish a subscription for a livestream's chat messages

func TopContributorsQuery

func TopContributorsQuery() string

TopContributorsQuery gives the graphql query to get data about users who are the top contributors for a livestream page

func UnbanStreamChatUserMutation

func UnbanStreamChatUserMutation() string

UnbanStreamChatUserMutation returns the graphql mutation for unbanning a user in a streamer's chat

func UnfollowUserMutation

func UnfollowUserMutation() string

UnfollowUserMutation returns the graphql mutation for unfollowing a streamer

func VideoPermLinkMutation

func VideoPermLinkMutation() string

VideoPermLinkMutation returns the graphql mutation for uploading a video to DLive

Types

type AddModeratorArgs

type AddModeratorArgs struct {
	Username string `json:"username"`
}

type AllowedActionsArgs

type AllowedActionsArgs struct {
	Username string `json:"username"`
	Streamer string `json:"streamer"`
}

type BanStreamChatUserArgs

type BanStreamChatUserArgs UnbanStreamChatUserArgs

type BrowsePageSearchCategoriesArgs

type BrowsePageSearchCategoriesArgs struct {
	Text  string `json:"text"`
	First int    `json:"first"`
	After string `json:"after"`
}

type Client

type Client struct {
	Endpoint          string          // The endpoint for DLive's API
	WebsocketEndpoint string          // The endpoint used for making websocket connections
	Auth              string          // An authorization token to send along with requests
	Feeds             map[string]Feed // Any active websocket streams the client is consuming
}

Client is used to send requests to DLive's API

func (*Client) AllowedActions

func (c *Client) AllowedActions(args AllowedActionsArgs) (Response, error)

func (*Client) Feed

func (c *Client) Feed(key string) (*Feed, error)

func (*Client) FeedCount

func (c *Client) FeedCount() int

func (*Client) GlobalInformation

func (c *Client) GlobalInformation() (Response, error)

GlobalInformation fetches language information about DLive

func (*Client) LivestreamChatRoomInfo

func (c *Client) LivestreamChatRoomInfo(args LivestreamChatRoomInfoArgs) (Response, error)

func (*Client) LivestreamPage

func (c *Client) LivestreamPage(args LivestreamPageArgs) (Response, error)

Query Methods

func (*Client) LivestreamProfileFollowers

func (c *Client) LivestreamProfileFollowers(args LivestreamProfileFollowersArgs) (Response, error)

func (*Client) LivestreamProfileFollowing

func (c *Client) LivestreamProfileFollowing(args LivestreamProfileFollowingArgs) (Response, error)

func (*Client) LivestreamProfileReplays

func (c *Client) LivestreamProfileReplays(args LivestreamProfileReplayArgs) (Response, error)

func (*Client) LivestreamProfileVideos

func (c *Client) LivestreamProfileVideos(args LivestreamProfileVideoArgs) (Response, error)

func (*Client) LivestreamProfileWallet

func (c *Client) LivestreamProfileWallet(args LivestreamProfileWalletArgs) (Response, error)

func (*Client) MeBalance

func (c *Client) MeBalance() (Response, error)

func (*Client) MeDashboard

func (c *Client) MeDashboard(args MeDashboardArgs) (Response, error)

func (*Client) MeGlobal

func (c *Client) MeGlobal() (Response, error)

func (*Client) MeLivestream

func (c *Client) MeLivestream(args MeLivestreamArgs) (Response, error)

func (*Client) MePartnerProgress

func (c *Client) MePartnerProgress() (Response, error)

func (*Client) MeSubscribing

func (c *Client) MeSubscribing(args MeSubscribingArgs) (Response, error)

func (*Client) Send

func (c *Client) Send(req Request) (Response, error)

Send takes the provided request, sends it to the DLive API endpoint, then returns the decoded JSON response

func (*Client) SendStreamChat

func (c *Client) SendStreamChat(args SendStreamChatMessageArgs) (Response, error)

Mutation Methods

func (*Client) StreamChatBannedUsers

func (c *Client) StreamChatBannedUsers(args StreamChatBannedUsersArgs) (Response, error)

func (*Client) StreamChatModerators

func (c *Client) StreamChatModerators(args StreamChatModeratorsArgs) (Response, error)

func (*Client) StreamMessageFeed

func (c *Client) StreamMessageFeed(args StreamMessageFeedArgs) (*Subscription, error)

Subscription Methods

func (*Client) TopContributors

func (c *Client) TopContributors(args TopContributorsArgs) (Response, error)

type DeleteChatArgs

type DeleteChatArgs struct {
	Streamer string `json:"streamer"`
	ID       string `json:"id"`
}

type DeleteEmoteInput

type DeleteEmoteInput struct {
	Level string `json:"level"`
	Name  string `json:"name"`
	Type  string `json:"type"`
}

type DeletePastBroadcastArgs

type DeletePastBroadcastArgs struct {
	Permlink string `json:"permlink"`
}

type DonateInput

type DonateInput struct {
	Count    int    `json:"count"`
	PermLink string `json:"permlink"`
	Type     string `json:"type"`
}

type EmoteDeleteArgs

type EmoteDeleteArgs struct {
	Input DeleteEmoteInput `json:"input"`
}

type EmoteSaveArgs

type EmoteSaveArgs struct {
	Input SaveEmoteInput `json:"input"`
}

type Feed

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

Feed is a real-time data stream using a websocket When a feed receives data from its websocket, its writes that data to all its subscribers

func (*Feed) Active

func (f *Feed) Active() bool

Active indicates if the feed has an active websocket connection

func (*Feed) Close

func (f *Feed) Close()

Close sends a termination signal to consumer go routine, closes the termination signal channel, and closes all subscriptions

func (*Feed) Consume

func (f *Feed) Consume(conn *websocket.Conn) (chan<- bool, <-chan []byte)

Consume uses the provided websocket to continuously read data from the socket and write it to the downstream channel Go routine will return when a termination signal is sent via the quit channel

func (*Feed) Publish

func (f *Feed) Publish(p []byte) (int, error)

Publish will send the data given to all output channels it currently knows of Returns the length of data, times the number of output channels data was written to Returns an error if Feed has no output channels

func (*Feed) Start

func (f *Feed) Start(socketRequest WebSocketRequest, websocketFunc WebsocketFunc) error

Start uses the provided Request and websocketFunc to start a GraphQL websocket connection Returns an error if the feed already been started

func (*Feed) String

func (f *Feed) String() string

func (*Feed) Subscribe

func (f *Feed) Subscribe() (*Subscription, error)

Subscribe creates a new Subscription for the feed

func (*Feed) Unsubscribe

func (f *Feed) Unsubscribe(subscription Subscription)

Unsubscribe closes the subscription's channel and removes it from its map of subscribers

type FeedMessage

type FeedMessage struct {
	MessageType string                 `json:"type"`    // The type of message sent from the API
	Payload     map[string]interface{} `json:"payload"` // The contents of the Response body
}

FeedMessage represents a GraphQL subscription message from DLive's API

type FollowUserArgs

type FollowUserArgs struct {
	Streamer string `json:"streamer"`
}

type FollowingPageLivestreamsArgs

type FollowingPageLivestreamsArgs struct {
	First int    `json:"first"`
	After string `json:"after"`
}

type FollowingPageVideosArgs

type FollowingPageVideosArgs FollowingPageLivestreamsArgs

type HomePageCarouselsArgs

type HomePageCarouselsArgs struct {
	Count            int    `json:"count"`
	UserLanguageCode string `json:"userLanguageCode"`
}

type HomePageCategoriesArgs

type HomePageCategoriesArgs struct {
	First      int    `json:"first"`
	After      string `json:"after"`
	LanguageID int    `json:"languageID"`
}

type HomePageLivestreamArgs

type HomePageLivestreamArgs struct {
	First            int    `json:"first"`
	After            string `json:"after"`
	LanguageID       int    `json:"languageID"`
	CategoryID       int    `json:"categoryID"`
	ShowNSFW         bool   `json:"showNSFW"`
	UserLanguageCode string `json:"user_language_code"`
}

type LivestreamChatRoomInfoArgs

type LivestreamChatRoomInfoArgs struct {
	DisplayName string `json:"displayname"`
	IsLoggedIn  bool   `json:"isLoggedIn"`
	Limit       int    `json:"limit"`
}

type LivestreamLanguagesArgs

type LivestreamLanguagesArgs struct {
	CategoryID int `json:"categoryID"`
}

type LivestreamPageArgs

type LivestreamPageArgs struct {
	DisplayName string `json:"displayname"`
	Add         bool   `json:"add"`
	IsLoggedIn  bool   `json:"isLoggedIn"`
}

type LivestreamPageRefetchArgs

type LivestreamPageRefetchArgs LivestreamPageArgs

type LivestreamProfileFollowersArgs

type LivestreamProfileFollowersArgs struct {
	DisplayName string `json:"displayname"`
	SortedBy    string `json:"sortedBy"`
	First       int    `json:"first"`
	After       string `json:"after"`
	IsLoggedIn  bool   `json:"isLoggedIn"`
}

type LivestreamProfileFollowingArgs

type LivestreamProfileFollowingArgs LivestreamProfileFollowersArgs

type LivestreamProfileReplayArgs

type LivestreamProfileReplayArgs struct {
	DisplayName string `json:"displayname"`
	First       int    `json:"first"`
	After       string `json:"after"`
}

type LivestreamProfileVideoArgs

type LivestreamProfileVideoArgs struct {
	DisplayName string `json:"displayname"`
	SortedBy    string `json:"sortedBy"`
	First       int    `json:"first"`
	After       string `json:"after"`
}

type LivestreamProfileWalletArgs

type LivestreamProfileWalletArgs struct {
	DisplayName string `json:"displayname"`
	First       int    `json:"first"`
	After       string `json:"after"`
	IsLoggedIn  bool   `json:"isLoggedIn"`
}

type LoginWithWalletArgs

type LoginWithWalletArgs struct {
	Payload       string `json:"payload"`
	SignedPayload string `json:"signed_payload"`
}

type MeDashboardArgs

type MeDashboardArgs struct {
	IsLoggedIn bool `json:"isLoggedIn"`
}

type MeLivestreamArgs

type MeLivestreamArgs struct {
	IsLoggedIn bool `json:"isLoggedIn"`
}

type MeSubscribingArgs

type MeSubscribingArgs struct {
	First int    `json:"first"`
	After string `json:"after"`
}

type RemoveModeratorArgs

type RemoveModeratorArgs AddModeratorArgs

type Request

type Request struct {
	Query string      `json:"query"`
	Vars  interface{} `json:"variables"`
}

type Response

type Response struct {
	Data   map[string]interface{} `json:"data"`
	Errors []responseError        `json:"errors"`
}

type SaveEmoteInput

type SaveEmoteInput struct {
	Level   string `json:"level"`
	MyLevel string `json:"myLevel"`
	Name    string `json:"name"`
	Type    string `json:"type"`
}

type SearchPageArgs

type SearchPageArgs struct {
	Text       string `json:"text"`
	First      int    `json:"first"`
	After      string `json:"after"`
	IsLoggedIn bool   `json:"isLoggedIn"`
}

type SendStreamChatMessageArgs

type SendStreamChatMessageArgs struct {
	Input SendStreamChatMessageInput `json:"input"`
}

type SendStreamChatMessageInput

type SendStreamChatMessageInput struct {
	Message     string `json:"message"`
	RoomRole    string `json:"roomRole"`
	Streamer    string `json:"streamer"`
	Subscribing bool   `json:"subscribing"`
}

type SetAllowStickerArgs

type SetAllowStickerArgs struct {
	Allow bool `json:"allow"`
}

type SetChatIntervalArgs

type SetChatIntervalArgs struct {
	Seconds int `json:"seconds"`
}

type SetStreamTemplateArgs

type SetStreamTemplateArgs struct {
	Template SetStreamTemplateInput `json:"template"`
}

type SetStreamTemplateInput

type SetStreamTemplateInput struct {
	AgeRestriction bool    `json:"ageRestriction"`
	CategoryID     int     `json:"categoryID"`
	DisableAlert   bool    `json:"disableAlert"`
	LanguageID     int     `json:"languageID"`
	ThumbnailURL   url.URL `json:"thumbnailUrl"`
	Title          string  `json:"title"`
}

type StreamChatBannedUsersArgs

type StreamChatBannedUsersArgs struct {
	DisplayName string `json:"displayname"`
	First       int    `json:"first"`
	After       string `json:"after"`
	Search      string `json:"search"`
}

type StreamChatModeratorsArgs

type StreamChatModeratorsArgs StreamChatBannedUsersArgs

type StreamDonateArgs

type StreamDonateArgs struct {
	Input DonateInput `json:"input"`
}

type StreamMessageFeedArgs

type StreamMessageFeedArgs struct {
	Streamer string `json:"streamer"`
}

type Subscription

type Subscription struct {
	Key      string        // The unique ID for this subscription for its feed
	Messages <-chan []byte // Channel that all new Response are written to
	// contains filtered or unexported fields
}

func (Subscription) Close

func (s Subscription) Close()

Close removes this subscription from the feed

type TopContributorsArgs

type TopContributorsArgs struct {
	DisplayName string `json:"displayname"`
	Rule        string `json:"rule"`
	First       int    `json:"first"`
	After       string `json:"after"`
	QueryStream bool   `json:"queryStream"`
}

type UnbanStreamChatUserArgs

type UnbanStreamChatUserArgs struct {
	Streamer string `json:"streamer"`
	Username string `json:"username"`
}

type UnfollowUserArgs

type UnfollowUserArgs FollowUserArgs

type WebSocketRequest

type WebSocketRequest struct {
	ID      string  `json:"id"`
	Type    string  `json:"type"`
	Payload Request `json:"payload"`
}

type WebsocketFunc

type WebsocketFunc func(request WebSocketRequest) (*websocket.Conn, error)

WebsocketFunc is the function used to setup the websocket used by a Feed

Jump to

Keyboard shortcuts

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