news

package
v0.0.0-...-e831e68 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixedData

func FixedData(topic string)

func InsertData

func InsertData(topic string, data []NewsItem)

func InsertDataEx

func InsertDataEx(topic string, databaseName string, data []NewsItem)

func UpdateAnalyseFieldInDatabase

func UpdateAnalyseFieldInDatabase(topic string)

Types

type NewsItem

type NewsItem struct {
	ID      int64      `bson:"id"`
	Title   string     `bson:"title"`
	Date    *time.Time `bson:"date"`
	Link    string     `bson:"link"`
	Source  string     `bson:"source,omitempty"`
	Score   string     `bson:"score"`
	Analyse string     `bson:"analyse"`
	// contains filtered or unexported fields
}

func CollectNews

func CollectNews(topic string, durationHour int) []NewsItem

type ScoreResponse

type ScoreResponse struct {
	Score   string `json:"score"`
	Analyse string `json:"analyse"`
}

Define a struct that matches the JSON structure

Jump to

Keyboard shortcuts

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