cards

package
v0.0.0-...-2274a5a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(i interface{}) ([]byte, error)

Types

type Card

type Card struct {
	//ID     string   `json:"id"`
	Text   string   `json:"text"`
	HTML   string   `json:"html"`
	Photos []string `json:"photos"`
	URLs   []string `json:"urls"`
}

Card type is the public struct for embedded card into tweets.

type SummaryCardParser

type SummaryCardParser struct{}

SummaryCardParser implements TwitterCardParser interface

func (*SummaryCardParser) Parse

func (p *SummaryCardParser) Parse(bindingValues map[string]interface{}) (card *Card)

type SummaryLargeCardParser

type SummaryLargeCardParser struct{}

SummaryLargeCardParser implements TwitterCardParser interface

func (*SummaryLargeCardParser) Parse

func (p *SummaryLargeCardParser) Parse(bindingValues map[string]interface{}) (card *Card)

type TwitterCardParser

type TwitterCardParser interface {
	Parse(bindingValues map[string]interface{}) *Card
}

TwitterCard defines the interface for parsing different twitter cards (summary, unified, ...)

func GetTwitterCardParserByName

func GetTwitterCardParserByName(name string) TwitterCardParser

type UnifiedCardParser

type UnifiedCardParser struct{}

UnifiedCardParser implements TwitterCardParser interface

func (*UnifiedCardParser) Parse

func (p *UnifiedCardParser) Parse(bindingValues map[string]interface{}) *Card

Jump to

Keyboard shortcuts

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