content

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package content provides ContentContext for accessing Longbridge content APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentContext

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

ContentContext is a client for interacting with Longbridge Content OpenAPI

func NewFromCfg

func NewFromCfg(cfg *config.Config) (*ContentContext, error)

NewFromCfg returns a ContentContext with config.Config.

func NewFromEnv

func NewFromEnv() (*ContentContext, error)

NewFromEnv returns a ContentContext configured from environment variables.

func (*ContentContext) News

func (c *ContentContext) News(ctx context.Context, symbol string) (items []*NewsItem, err error)

News returns the news list for a symbol. Reference: https://open.longbridge.com/en/docs/quote/security/news

func (*ContentContext) Topics

func (c *ContentContext) Topics(ctx context.Context, symbol string) (items []*TopicItem, err error)

Topics returns the discussion topics list for a symbol. Reference: https://open.longbridge.com/en/docs/quote/security/topics

type NewsItem

type NewsItem struct {
	// News ID
	Id string
	// Title
	Title string
	// Description
	Description string
	// URL
	Url string
	// Published time
	PublishedAt time.Time
	// Comments count
	CommentsCount int32
	// Likes count
	LikesCount int32
	// Shares count
	SharesCount int32
}

NewsItem is a news article for a security

type TopicItem

type TopicItem struct {
	// Topic ID
	Id string
	// Title
	Title string
	// Description
	Description string
	// URL
	Url string
	// Published time
	PublishedAt time.Time
	// Comments count
	CommentsCount int32
	// Likes count
	LikesCount int32
	// Shares count
	SharesCount int32
}

TopicItem is a discussion topic for a security

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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