commentapi

package module
v0.0.0-...-3b4b688 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 5900

DefaultPort the default port that is used for commentron client

Variables

View Source
var StickerRE = regexp.MustCompile(`^<stkr>:(?P<sticker>[a-zA-Z0-9_]+):<stkr>$`)

StickerRE is the regex for a valid sticker as a comment.

Functions

func InviteMemberStatusFrom

func InviteMemberStatusFrom(v null.Bool, createdAt time.Time, expired null.Uint64) string

InviteMemberStatusFrom from a `null.Bool` it provides the functional value

Types

type AbandonArgs

type AbandonArgs struct {
	ModAuthorization
	CommentID string `json:"comment_id"`
}

AbandonArgs are the arguments passed to comment.Abandon RPC call. If creator args are passed the signing channel of the content of the comment is checked these args and signature verification happens against the creators public key for authorization.

type AbandonResponse

type AbandonResponse struct {
	*CommentItem
	Abandoned bool `json:"abandoned"`
}

AbandonResponse the response to the abandon call

type AddDelegateArgs

type AddDelegateArgs struct {
	ModChannelID       string `json:"mod_channel_id"`
	ModChannelName     string `json:"mod_channel_name"`
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	Signature          string `json:"signature"`
	SigningTS          string `json:"signing_ts"`
}

AddDelegateArgs Arguments to delagate moderation to another channel for your channel.

type AmIArgs

type AmIArgs struct {
	ChannelName string `json:"channel_name"`
	ChannelID   string `json:"channel_id"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
}

AmIArgs Arguments to check whether a user is a moderator or not

type AmIResponse

type AmIResponse struct {
	ChannelName        string            `json:"channel_name"`
	ChannelID          string            `json:"channel_id"`
	Type               string            `json:"type"`
	AuthorizedChannels map[string]string `json:"authorized_channels"`
}

AmIResponse for the moderation.AmI rpc call

type Appeal

type Appeal struct {
	BlockedList    SharedBlockedList `json:"blocked_list,omitempty"`
	BlockedChannel BlockedChannel    `json:"blocked_channel"`
	AppealRequest  AppealRequest     `json:"appeal_request,omitempty"`
}

Appeal structure for an appeal

type AppealBlockListArgs

type AppealBlockListArgs struct {
	Authorization
}

AppealBlockListArgs arguments

type AppealBlockListResponse

type AppealBlockListResponse struct {
	Blocks []Appeal `json:"blocks"`
}

AppealBlockListResponse response

type AppealCloseArgs

type AppealCloseArgs struct {
	Authorization

	BlockedChannelID   string       `json:"blocked_channel_id"`
	BlockedChannelName string       `json:"blocked_channel_name"`
	AppealStatus       AppealStatus `json:"status"`
	ResponseMessage    string       `json:"response_message"`
}

AppealCloseArgs arguments

type AppealFileArgs

type AppealFileArgs struct {
	Authorization

	SharedBlockedListID  uint64 `json:"blocked_list_id"`
	BlockedByChannelID   string `json:"blocked_by_channel_id"`
	BlockedByChannelName string `json:"blocked_by_channel_name"`
	AppealMessage        string `json:"appeal_message"`
	TxID                 string `json:"tx_id,omitempty"`
}

AppealFileArgs arguments

type AppealListArgs

type AppealListArgs struct {
	ModAuthorization
}

AppealListArgs arguments

type AppealListResponse

type AppealListResponse struct {
	Appeals          []Appeal `json:"appeals"`
	ModeratedAppeals []Appeal `json:"moderated_appeals"`
}

AppealListResponse response

type AppealRequest

type AppealRequest struct {
	AppealMessage   string       `json:"appeal_message"`
	ResponseMessage string       `json:"response_message"`
	AppealStatus    AppealStatus `json:"status"`
	TxID            string       `json:"tx_id,omitempty"`
}

AppealRequest appeal request

type AppealStatus

type AppealStatus int

AppealStatus status of appeal

const (
	// AppealPending the default value for all appeals
	AppealPending AppealStatus = iota
	// AppealEscalated appeal is escalated to shared block list owner
	AppealEscalated
	// AppealAccepted creator who blocked, has accepted the appeal
	AppealAccepted
	// AppealRejected creator who blocked, has rejected the appeal
	AppealRejected
)

type Authorization

type Authorization struct {
	ChannelName string `json:"channel_name"`
	ChannelID   string `json:"channel_id"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
}

Authorization parameters for calls requiring user authentication

type BlockArgs

type BlockArgs struct {
	//Publisher, Moderator, or Commentron Admin
	ModChannelID   string `json:"mod_channel_id"`
	ModChannelName string `json:"mod_channel_name"`
	//Offender being blocked
	BlockedChannelID   string `json:"blocked_channel_id"`
	BlockedChannelName string `json:"blocked_channel_name"`
	//Creator that Moderator is delegated from. Used for delegated moderation
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	// ID of comment to remove as part of this block
	OffendingCommentID string `json:"offending_comment_id"`
	// Blocks identity from comment universally, requires Admin rights on commentron instance
	BlockAll bool `json:"block_all"`
	// Measured in seconds for the amount of time a channel is blocked for.
	TimeOut uint64 `json:"time_out"`
	// If true will delete all comments of the offender, requires Admin rights on commentron for universal delete
	DeleteAll bool   `json:"delete_all"`
	Signature string `json:"signature"`
	SigningTS string `json:"signing_ts"`
}

BlockArgs Arguments to block identities from commenting for both publisher and moderators

type BlockResponse

type BlockResponse struct {
	DeletedCommentIDs []string `json:"deleted_comment_ids"`
	BannedChannelID   string   `json:"banned_channel_id"`
	AllBlocked        bool     `json:"all_blocked"`
	//Publisher banned from if not universally banned
	BannedFrom *string `json:"banned_from"`
}

BlockResponse for the moderation.Block rpc call

type BlockWordArgs

type BlockWordArgs struct {
	Authorization
	// CSV list of containing words to block comment on content
	Words string `json:"words"`
}

BlockWordArgs arguments passed to settings.BlockWord. Appends to list

func (BlockWordArgs) Validate

func (b BlockWordArgs) Validate() api.StatusError

Validate validates the data in the args

type BlockWordRespose

type BlockWordRespose struct {
	//If added to list, removed from list, or list all
	WordList  []string `json:"word_list"`
	Signature string   `json:"signature"`
	SigningTS string   `json:"signing_ts"`
}

BlockWordRespose result from BlockWord,UnBlockWord, ListBlockedWords. Lists the words added/removed or all.

type BlockedChannel

type BlockedChannel struct {
	BlockedChannelID   string `json:"blocked_channel_id"`
	BlockedChannelName string `json:"blocked_channel_name"`
	//In cases of moderation delegation this could be "other than" the creator
	BlockedByChannelID   string        `json:"blocked_by_channel_id"`
	BlockedByChannelName string        `json:"blocked_by_channel_name"`
	BlockedAt            time.Time     `json:"blocked_at"`
	BlockedFor           time.Duration `json:"banned_for,omitempty"`
	BlcokRemaining       time.Duration `json:"ban_remaining"`
}

BlockedChannel contains information about the blockee blocked by the creator

type BlockedListArgs

type BlockedListArgs struct {
	//Publisher, Moderator or Commentron Admin
	ModChannelID   string `json:"mod_channel_id"`
	ModChannelName string `json:"mod_channel_name"`
	//Creator that Moderator is delegated from. Used for delegated moderation
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	Signature          string `json:"signature"`
	SigningTS          string `json:"signing_ts"`
}

BlockedListArgs Arguments to block identities from commenting for both publisher and moderators

type BlockedListResponse

type BlockedListResponse struct {
	BlockedChannels          []BlockedChannel `json:"blocked_channels"`
	DelegatedBlockedChannels []BlockedChannel `json:"delegated_blocked_channels"`
	GloballyBlockedChannels  []BlockedChannel `json:"globally_blocked_channels"`
}

BlockedListResponse for the moderation.Block rpc call

type ByIDArgs

type ByIDArgs struct {
	CommentID     string `json:"comment_id"`
	WithAncestors bool   `json:"with_ancestors"`
}

ByIDArgs arguments for the comment.List rpc call

type ByIDResponse

type ByIDResponse struct {
	Item      CommentItem   `json:"items,omitempty"`
	Ancestors []CommentItem `json:"ancestors,omitempty"`
}

ByIDResponse response for the comment.ByID rpc call

type ChannelArgs

type ChannelArgs struct {
	CommentID string `json:"comment_id"`
}

ChannelArgs arguments to the comment.GetChannelForCommentID call

type ChannelResponse

type ChannelResponse struct {
	ChannelID   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
}

ChannelResponse response to the comment.GetChannelForCommentID call

type Client

type Client struct {
	Channel *lbry.Channel
	// contains filtered or unexported fields
}

Client commentron client for apis

func NewClient

func NewClient(address string) *Client

NewClient init for creating a commentron client

func (*Client) CommentAbandon

func (d *Client) CommentAbandon(args AbandonArgs) (*AbandonResponse, error)

CommentAbandon abandons a comment

func (*Client) CommentByID

func (d *Client) CommentByID(args ByIDArgs) (*ByIDResponse, error)

CommentByID returns a comment for id

func (*Client) CommentCreate

func (d *Client) CommentCreate(args CreateArgs) (*CreateResponse, error)

CommentCreate creates a comment

func (*Client) CommentEdit

func (d *Client) CommentEdit(args EditArgs) (*EditResponse, error)

CommentEdit edits a comment

func (*Client) CommentList

func (d *Client) CommentList(args ListArgs) (*ListResponse, error)

CommentList lists comments for a claim or parent comment

func (*Client) GetChannelForComment

func (d *Client) GetChannelForComment(args ChannelArgs) (*ChannelResponse, error)

GetChannelForComment returns the channel information for a particular comment

func (*Client) ReactionList

func (d *Client) ReactionList(args ReactionListArgs) (*ReactionListResponse, error)

ReactionList lists reactions to comments

func (*Client) ReactionReact

func (d *Client) ReactionReact(args ReactArgs) (*ReactResponse, error)

ReactionReact posts a new reaction to a comment

func (*Client) Sign

func (d *Client) Sign(args interface{}) interface{}

Sign will sign arguments if a channel has been loaded into the client to sign with. It will also overwrite channel name and channel claim id argument parameters if they exist with the channel info being signed with.

func (*Client) WithSigning

func (d *Client) WithSigning(export string) *Client

WithSigning allows for a client to be used with identity priviledges handling the signing of APIs requiring user authorization. It requires the channel export string `./lbrynet channel export <channel_id>` as well as an authorized apiKey from the comment server owner.

type CommentItem

type CommentItem struct {
	Comment       string  `json:"comment"`
	CommentID     string  `json:"comment_id"`
	ClaimID       string  `json:"claim_id"`
	Timestamp     int     `json:"timestamp"`
	ParentID      string  `json:"parent_id,omitempty"`
	Signature     string  `json:"signature,omitempty"`
	SigningTs     string  `json:"signing_ts,omitempty"`
	ChannelID     string  `json:"channel_id,omitempty"`
	ChannelName   string  `json:"channel_name,omitempty"`
	ChannelURL    string  `json:"channel_url,omitempty"`
	Currency      string  `json:"currency"`
	Replies       int     `json:"replies,omitempty"`
	SupportAmount float64 `json:"support_amount"`
	IsCreator     bool    `json:"is_creator,omitempty"`
	IsModerator   bool    `json:"is_moderator,omitempty"`
	IsGlobalMod   bool    `json:"is_global_mod,omitempty"`
	IsHidden      bool    `json:"is_hidden"`
	IsPinned      bool    `json:"is_pinned"`
	IsFiat        bool    `json:"is_fiat"`
}

CommentItem is the data structure of a comment returned from commentron

type CommentReaction

type CommentReaction map[string]int

CommentReaction is a map for representing the reaction and its quantity for a comment

type CreateArgs

type CreateArgs struct {
	CommentText       string             `json:"comment"`
	ClaimID           string             `json:"claim_id"`
	ParentID          *string            `json:"parent_id"`
	ChannelID         string             `json:"channel_id"`
	ChannelName       string             `json:"channel_name"`
	Sticker           bool               `json:"sticker"`
	SupportTxID       *string            `json:"support_tx_id"`
	SupportVout       *uint64            `json:"support_vout"`
	PaymentIntentID   *string            `json:"payment_intent_id"`
	Environment       *string            `json:"environment"`
	Signature         string             `json:"signature"`
	SigningTS         string             `json:"signing_ts"`
	MentionedChannels []MentionedChannel `json:"mentioned_channels"`
}

CreateArgs arguments for the comment.Create rpc call

type CreateResponse

type CreateResponse struct {
	*CommentItem
}

CreateResponse response for the comment.Create rpc call

type Delegate

type Delegate struct {
	ChannelID   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
}

Delegate a particular channel thats delegated moderation capabilities

type EditArgs

type EditArgs struct {
	Comment   string `json:"comment"`
	CommentID string `json:"comment_id"`
	Signature string `json:"signature"`
	SigningTS string `json:"signing_ts"`
}

EditArgs arguments for the comment.Edit rpc call

type EditResponse

type EditResponse struct {
	*CommentItem
}

EditResponse response for the comment.Edit rpc call

type InviteMemberStatus

type InviteMemberStatus int

InviteMemberStatus status of invited member

const (
	// All the defult value for getting all invited members
	All InviteMemberStatus = iota
	// Pending invite has not been accepted or rejected
	Pending
	// Accepted invited member has accepted and their blocked entries merged into list
	Accepted
	// Rejected invited member rejected joining the list and their blocked entries are cleared.
	Rejected
	// None does not return any invited members of the list
	None
)

type ListArgs

type ListArgs struct {
	RequestorChannelName string  `json:"requestor_channel_name"` // Used for Author ID filter authorization Only your comments!
	RequestorChannelID   string  `json:"requestor_channel_id"`   // Used for Author ID filter authorization
	ChannelName          *string `json:"channel_name"`           // signing channel name of claim
	ChannelID            *string `json:"channel_id"`             // signing channel claim id of claim
	ClaimID              *string `json:"claim_id"`               // claim id of claim being commented on
	AuthorClaimID        *string `json:"author_claim_id"`        // filters comments to just this author
	ParentID             *string `json:"parent_id"`              // filters comments to those under this thread
	Page                 int     `json:"page"`                   // pagination: which page of results
	PageSize             int     `json:"page_size"`              // pagination: nr of comments to show in a page (max 200)
	TopLevel             bool    `json:"top_level"`              // filters to only top level comments
	Hidden               bool    `json:"hidden"`                 // if true will show hidden comments as well
	SortBy               Sort    `json:"sort_by"`                // can be popularity, controversy, default is time (newest)
	Signature            string  `json:"signature"`
	SigningTS            string  `json:"signing_ts"`
}

ListArgs arguments for the comment.List rpc call

func (*ListArgs) ApplyDefaults

func (c *ListArgs) ApplyDefaults()

ApplyDefaults applies the default values for arguments passed that are different from normal defaults.

func (*ListArgs) Key

func (c *ListArgs) Key() (string, error)

Key returns the hash of the list args struct for caching

func (ListArgs) Validate

func (c ListArgs) Validate() api.StatusError

Validate validates the data in the list args

type ListBlockedWordsArgs

type ListBlockedWordsArgs struct {
	Authorization
}

ListBlockedWordsArgs lists all the blocked words for the channel

func (ListBlockedWordsArgs) Validate

func (b ListBlockedWordsArgs) Validate() api.StatusError

Validate validates the data in the args

type ListDelegateResponse

type ListDelegateResponse struct {
	Delegates []Delegate
}

ListDelegateResponse response for modifying the delegates

type ListDelegatesArgs

type ListDelegatesArgs struct {
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	Signature          string `json:"signature"`
	SigningTS          string `json:"signing_ts"`
}

ListDelegatesArgs Arguments to list delegates

type ListResponse

type ListResponse struct {
	Page               int           `json:"page"`
	PageSize           int           `json:"page_size"`
	TotalPages         int           `json:"total_pages"`
	TotalItems         int64         `json:"total_items"`
	TotalFilteredItems int64         `json:"total_filtered_items"`
	Items              []CommentItem `json:"items,omitempty"`
	HasHiddenComments  bool          `json:"has_hidden_comments"`
}

ListResponse response for the comment.List rpc call

type ListSettingsArgs

type ListSettingsArgs struct {
	ChannelName string `json:"channel_name"`
	ChannelID   string `json:"channel_id"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
}

ListSettingsArgs arguments passed to settings.List api

type ListSettingsResponse

type ListSettingsResponse struct {
	// CSV list of containing words to block comment on content
	Words                      *string  `json:"words,omitempty"`
	CommentsEnabled            *bool    `json:"comments_enabled"`
	MinTipAmountComment        *float64 `json:"min_tip_amount_comment"`
	MinTipAmountSuperChat      *float64 `json:"min_tip_amount_super_chat"`
	SlowModeMinGap             *uint64  `json:"slow_mode_min_gap"`
	CurseJarAmount             *uint64  `json:"curse_jar_amount"`
	FiltersEnabled             *bool    `json:"filters_enabled,omitempty"`
	ChatOverlay                *bool    `json:"chat_overlay"`
	ChatOverlayPosition        *string  `json:"chat_overlay_position"`
	ChatRemoveComment          *uint64  `json:"chat_remove_comment"`
	StickerOverlay             *bool    `json:"sticker_overlay"`
	StickerOverlayKeep         *bool    `json:"sticker_overlay_keep"`
	StickerOverlayRemove       *uint64  `json:"sticker_overlay_remove"`
	ViewercountOverlay         *bool    `json:"viewercount_overlay"`
	ViewercountOverlayPosition *string  `json:"viewercount_overlay_position"`
	ViewercountChatBot         *bool    `json:"viewercount_chat_bot"`
	TipgoalOverlay             *bool    `json:"tipgoal_overlay"`
	TipgoalAmount              *uint64  `json:"tipgoal_amount"`
	TipgoalOverlayPosition     *string  `json:"tipgoal_overlay_position"`
	TipgoalPreviousDonations   *bool    `json:"tipgoal_previous_donations"`
	TipgoalCurrency            *string  `json:"tipgoal_currency"`
}

ListSettingsResponse returns all the settings for creator/user

type MentionedChannel

type MentionedChannel struct {
	ChannelName string `json:"channel_name"`
	ChannelID   string `json:"channel_id"`
}

MentionedChannel channels mentioned in comment

type ModAuthorization

type ModAuthorization struct {
	//Publisher, Moderator or Commentron Admin
	ModChannelID   string `json:"mod_channel_id"`
	ModChannelName string `json:"mod_channel_name"`
	//Creator that Moderator is delegated from. Used for delegated moderation
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	Signature          string `json:"signature"`
	SigningTS          string `json:"signing_ts"`
}

ModAuthorization parameters for calls requiring creator/moderator authentication

type PinArgs

type PinArgs struct {
	CommentID   string `json:"comment_id"`
	ChannelID   string `json:"channel_id"`
	ChannelName string `json:"channel_name"` //Technical debt? probably dont need this since we can get the channel from the comment claim
	Remove      bool   `json:"remove"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
}

PinArgs arguments for the comment.Pin rpc call. The comment id must be signed with a timestamp for authentication.

type PinResponse

type PinResponse struct {
	Item CommentItem `json:"items,omitempty"`
}

PinResponse response for the comment.Pin rpc call

type ReactArgs

type ReactArgs struct {
	CommentIDs  string `json:"comment_ids"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
	Remove      bool   `json:"remove"`
	ClearTypes  string `json:"clear_types"`
	Type        string `json:"type"`
	ChannelID   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
}

ReactArgs are the arguments passed to comment.Abandon RPC call

type ReactResponse

type ReactResponse struct {
	Reactions
}

ReactResponse the response to the abandon call

type ReactionListArgs

type ReactionListArgs struct {
	CommentIDs  string `json:"comment_ids"`
	Signature   string `json:"signature"`
	SigningTS   string `json:"signing_ts"`
	Types       *string
	ChannelID   *string `json:"channel_id"`
	ChannelName *string `json:"channel_name"`
}

ReactionListArgs are the arguments passed to comment.Abandon RPC call

type ReactionListResponse

type ReactionListResponse struct {
	MyReactions     Reactions `json:"my_reactions,omitempty"`
	OthersReactions Reactions `json:"others_reactions"`
}

ReactionListResponse the response to the abandon call

type Reactions

type Reactions map[string]CommentReaction

Reactions a map structure where the key is the comment_id and the value is a CommentReaction

type RemoveDelegateArgs

type RemoveDelegateArgs struct {
	ModChannelID       string `json:"mod_channel_id"`
	ModChannelName     string `json:"mod_channel_name"`
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	Signature          string `json:"signature"`
	SigningTS          string `json:"signing_ts"`
}

RemoveDelegateArgs Arguments to remove a delegated moderator.

type SharedBlockedList

type SharedBlockedList struct {
	ID uint64 `json:"id"`
	// A user friendly identifier for the owner/users
	Name *string `json:"name"`
	// The category of block list this is so others search
	Category    *string `json:"category"`
	Description *string `json:"description"`
	// Can members invite others contributors?
	MemberInviteEnabled *bool `json:"member_invite_enabled"`
	// Strikes are number of hours a user should be banned for if
	// part of this blocked list. Strikes 1,2,3 are intended to be
	// progressively higher. Strike 3 is the highest.
	StrikeOne   *uint64 `json:"strike_one"`
	StrikeTwo   *uint64 `json:"strike_two"`
	StrikeThree *uint64 `json:"strike_three"`
	// The number of hours until a sent invite expires.
	InviteExpiration *uint64 `json:"invite_expiration"`
	// Curse jar allows automatic appeals. If they tip the owner of
	// the shared blocked list their appeal is automatically accepted.
	CurseJarAmount *uint64 `json:"curse_jar_amount"`
}

SharedBlockedList default representation of a shared blocked

type SharedBlockedListGetArgs

type SharedBlockedListGetArgs struct {
	Authorization                          // Authorization is required if no id is passed in, to return owner info
	SharedBlockedListID uint64             `json:"blocked_list_id"`
	Status              InviteMemberStatus `json:"status"`
}

SharedBlockedListGetArgs arguments for blocklist.Get

type SharedBlockedListGetResponse

type SharedBlockedListGetResponse struct {
	BlockedList    SharedBlockedList                `json:"shared_blocked_list"`
	InvitedMembers []SharedBlockedListInvitedMember `json:"invited_members"`
}

SharedBlockedListGetResponse response for blocklist.Get

type SharedBlockedListInvitation

type SharedBlockedListInvitation struct {
	BlockedList SharedBlockedList              `json:"shared_blocked_list"`
	Invitation  SharedBlockedListInvitedMember `json:"invitation"`
}

SharedBlockedListInvitation represents an invitation to a specific shared blocked list and the status

type SharedBlockedListInviteAcceptArgs

type SharedBlockedListInviteAcceptArgs struct {
	Authorization

	SharedBlockedListID uint64 `json:"blocked_list_id"`
	Accepted            bool   `json:"accepted"`
}

SharedBlockedListInviteAcceptArgs arguments for blocklist.Accept

type SharedBlockedListInviteAcceptResponse

type SharedBlockedListInviteAcceptResponse struct {
}

SharedBlockedListInviteAcceptResponse response for blocklist.Accept

type SharedBlockedListInviteArgs

type SharedBlockedListInviteArgs struct {
	Authorization

	SharedBlockedListID uint64 `json:"blocked_list_id"`
	InviteeChannelName  string `json:"invitee_channel_name"`
	InviteeChannelID    string `json:"invitee_channel_id"`
	Message             string `json:"message"`
}

SharedBlockedListInviteArgs arguments for blocklist.Invite

type SharedBlockedListInviteResponse

type SharedBlockedListInviteResponse struct {
}

SharedBlockedListInviteResponse empty respose for blocklist.Invite

type SharedBlockedListInvitedMember

type SharedBlockedListInvitedMember struct {
	InvitedByChannelName string `json:"invited_by_channel_name"`
	InvitedByChannelID   string `json:"invited_by_channel_id"`
	InvitedChannelName   string `json:"invited_channel_name"`
	InvitedChannelID     string `json:"invited_channel_id"`
	Status               string `json:"status"`
	InviteMessage        string `json:"message"`
}

SharedBlockedListInvitedMember representation of an InvitedMember

type SharedBlockedListListInvitesArgs

type SharedBlockedListListInvitesArgs struct {
	Authorization // Authorization is required if no id is passed in, to return owner info
}

SharedBlockedListListInvitesArgs arguments for blocklist.ListInvites

type SharedBlockedListListInvitesResponse

type SharedBlockedListListInvitesResponse struct {
	Invitations []SharedBlockedListInvitation `json:"invitations"`
}

SharedBlockedListListInvitesResponse response for blocklist.ListInvites

type SharedBlockedListRescindArgs

type SharedBlockedListRescindArgs struct {
	Authorization

	InvitedChannelName string `json:"invited_channel_name"`
	InvitedChannelID   string `json:"invited_channel_id"`
}

SharedBlockedListRescindArgs arguments for blocklist.Rescind

type SharedBlockedListRescindResponse

type SharedBlockedListRescindResponse struct {
}

SharedBlockedListRescindResponse response for blocklist.Rescind

type SharedBlockedListUpdateArgs

type SharedBlockedListUpdateArgs struct {
	Authorization
	SharedBlockedList
	Remove bool `json:"remove"`
}

SharedBlockedListUpdateArgs use for blockedlist.Update api

func (SharedBlockedListUpdateArgs) Validate

Validate validates the data in the update args

type SignatureArgs

type SignatureArgs struct {
	//Channel ID claiming to have signed the signature
	ChannelID string `json:"channel_id"`
	//The data payload in Hex that was signed
	DataHex string `json:"data_hex"`
	//Signature and timestamp returned from the channel_sign api of LBRY SDK
	Signature string `json:"signature"`
	SigningTS string `json:"signing_ts"`
}

SignatureArgs Arguments to verify the signature from a LBRY SDK

type SignatureResponse

type SignatureResponse struct {
	IsValid bool `json:"is_valid"`
}

SignatureResponse for the verify.Signature call

type Sort

type Sort int

Sort defines the type of sort for the comment.List api

const (
	// Newest sorts the comments by newest first
	Newest Sort = iota
	// Oldest sorts the comments from first to last
	Oldest
	// Controversy sorts the comments by controversy
	Controversy
	// Popularity sorts the comments by how popular it is
	Popularity
	// NewestNoPins sorts the comments by newest first but removes the presort for pinned comments
	NewestNoPins
)

type SuperListArgs

type SuperListArgs struct {
	ClaimID       *string `json:"claim_id"`
	AuthorClaimID *string `json:"author_claim_id"`
	ParentID      *string `json:"parent_id"`
	Page          int     `json:"page"`
	PageSize      int     `json:"page_size"`
	TopLevel      bool    `json:"top_level"`
	Hidden        bool    `json:"hidden"`
	// Satoshi amount to filter below >= x
	SuperChatsAmount int `json:"super_chat"`
}

SuperListArgs arguments for the comment.List rpc call

func (*SuperListArgs) ApplyDefaults

func (c *SuperListArgs) ApplyDefaults()

ApplyDefaults applies the default values for arguments passed that are different from normal defaults.

func (*SuperListArgs) Key

func (c *SuperListArgs) Key() (string, error)

Key returns the hash of the list args struct for caching

type SuperListResponse

type SuperListResponse struct {
	Page              int           `json:"page"`
	PageSize          int           `json:"page_size"`
	TotalPages        int           `json:"total_pages"`
	TotalItems        int64         `json:"total_items"`
	TotalAmount       float64       `json:"total_amount"`
	Items             []CommentItem `json:"items,omitempty"`
	HasHiddenComments bool          `json:"has_hidden_comments"`
}

SuperListResponse response for the comment.List rpc call

type UnBlockArgs

type UnBlockArgs struct {
	//Publisher, Moderator, or Commentron Admin
	ModChannelID   string `json:"mod_channel_id"`
	ModChannelName string `json:"mod_channel_name"`
	//Offender being unblocked
	UnBlockedChannelID   string `json:"un_blocked_channel_id"`
	UnBlockedChannelName string `json:"un_blocked_channel_name"`
	//Creator that Moderator is delegated from. Used for delegated moderation
	CreatorChannelID   string `json:"creator_channel_id"`
	CreatorChannelName string `json:"creator_channel_name"`
	// Unblocks identity from commenting universally, requires Admin rights on commentron instance
	GlobalUnBlock bool   `json:"global_un_block"`
	Signature     string `json:"signature"`
	SigningTS     string `json:"signing_ts"`
}

UnBlockArgs Arguments to un-block identities from commenting for both publisher and moderators

type UnBlockResponse

type UnBlockResponse struct {
	UnBlockedChannelID string `json:"un_blocked_channel_id"`
	GlobalUnBlock      bool   `json:"global_un_block"`
	//Publisher ban removed from if not universally unblocked
	UnBlockedFrom *string `json:"un_blocked_from"`
}

UnBlockResponse for the moderation.UnBlock rpc call

type UnBlockWordArgs

type UnBlockWordArgs struct {
	Authorization
	// CSV list of containing words to block comment on content
	Words string `json:"words"`
}

UnBlockWordArgs arguments passed to settings.UnBlockWord. Removes if exists

func (UnBlockWordArgs) Validate

func (b UnBlockWordArgs) Validate() api.StatusError

Validate validates the data in the args

type UpdateSettingsArgs

type UpdateSettingsArgs struct {
	Authorization
	CommentsEnabled            *bool    `json:"comments_enabled"`
	MinTipAmountComment        *float64 `json:"min_tip_amount_comment"`
	MinTipAmountSuperChat      *float64 `json:"min_tip_amount_super_chat"`
	SlowModeMinGap             *uint64  `json:"slow_mode_min_gap"`
	CurseJarAmount             *uint64  `json:"curse_jar_amount"`
	FiltersEnabled             *bool    `json:"filters_enabled"`
	ChatOverlay                *bool    `json:"chat_overlay"`
	ChatOverlayPosition        *string  `json:"chat_overlay_position"`
	ChatRemoveComment          *uint64  `json:"chat_remove_comment"`
	StickerOverlay             *bool    `json:"sticker_overlay"`
	StickerOverlayKeep         *bool    `json:"sticker_overlay_keep"`
	StickerOverlayRemove       *uint64  `json:"sticker_overlay_remove"`
	ViewercountOverlay         *bool    `json:"viewercount_overlay"`
	ViewercountOverlayPosition *string  `json:"viewercount_overlay_position"`
	ViewercountChatBot         *bool    `json:"viewercount_chat_bot"`
	TipgoalOverlay             *bool    `json:"tipgoal_overlay"`
	TipgoalAmount              *uint64  `json:"tipgoal_amount"`
	TipgoalOverlayPosition     *string  `json:"tipgoal_overlay_position"`
	TipgoalPreviousDonations   *bool    `json:"tipgoal_previous_donations"`
	TipgoalCurrency            *string  `json:"tipgoal_currency"`
}

UpdateSettingsArgs arguments for different settings that could be set

func (UpdateSettingsArgs) Validate

func (u UpdateSettingsArgs) Validate() api.StatusError

Validate validates the data in the args

type Validator

type Validator interface {
	Validate() api.StatusError
}

Validator for api arguments that should have some checks applied for every request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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