models

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Media

type Media struct {
	Source     MediaSource  `json:"source"`
	RequestUrl string       `json:"request_url"`
	Id         string       `json:"id"`
	Shortcode  string       `json:"shortcode"`
	Title      string       `json:"title"`
	Author     string       `json:"author"`
	Type       string       `json:"type"`
	Comments   uint64       `json:"comments_count"`
	Likes      uint64       `json:"likes_count"`
	Caption    string       `json:"caption"`
	Url        string       `json:"url"`
	Items      []*MediaItem `json:"items"`
	TakenAt    int64        `json:"taken_at"` // Timestamp
}

Media which contains a single Instagram post

func FromEmbedResponse

func FromEmbedResponse(embed response.EmbedResponse) Media

FromEmbedResponse will automatically transforms the EmbedResponse to the Media

type MediaItem

type MediaItem struct {
	Id                string    `json:"id"`
	Shortcode         string    `json:"shortcode"`
	Type              MediaType `json:"type"`
	VideoWithoutAudio bool      `json:"video_without_audio"`
	Url               string    `json:"url"`
	Quality           string    `json:"quality"`
	ContentLength     int64     `json:"content_length"`
	MimeType          string    `json:"mime_type"`
	Width             int       `json:"width"`
	Height            int       `json:"height"`
}

MediaItem contains information about the Instagram post which is similar to the Instagram Media struct

func (MediaItem) GetMediaDataByURL

func (s MediaItem) GetMediaDataByURL() (io.Reader, error)

type MediaSource

type MediaSource string
const (
	MediaSourceInstagram MediaSource = "instagram"
	MediaSourceYoutube   MediaSource = "youtube"
)

func (MediaSource) Valid

func (s MediaSource) Valid() bool

type MediaType

type MediaType string
const (
	MediaTypeAudio MediaType = "audio"
	MediaTypeVideo MediaType = "video"
	MediaTypePhoto MediaType = "photo"
)

func (MediaType) IsAudio

func (s MediaType) IsAudio() bool

func (MediaType) IsPhoto

func (s MediaType) IsPhoto() bool

func (MediaType) IsVideo

func (s MediaType) IsVideo() bool

func (MediaType) Valid

func (s MediaType) Valid() bool

type Owner

type Owner struct {
	Id                string `json:"id"`
	ProfilePictureURL string `json:"profile_pic_url"`
	Username          string `json:"username"`
	Followers         uint64 `json:"followers_count"`
	IsPrivate         bool   `json:"is_private"`
	IsVerified        bool   `json:"is_verified"`
}

Owner is a single Instagram user who owns the Media

Jump to

Keyboard shortcuts

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