utils

package
v0.0.0-...-f6a626a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromPtFormat

func ConvertFromPtFormat(pt string, targetFormat string) float64

ConvertFromPtFormat transforms a time duration string in the ISO_8601 format to a numeric representation in seconds, minutes, or hours.

Parameters:

  • pt: a string representing the time duration in the ISO_8601 format (e.g., "PT1H30M")
  • targetFormat: a string indicating the desired output format ("seconds", "minutes", or "hours")

Returns:

  • A float64 value representing the time duration in the specified format.

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string) error

func GetUniqueTrendingVideoIds

func GetUniqueTrendingVideoIds() ([]string, error)

GetUniqueTreningVideoIds returns a list of unique video IDs for the trending videos metadata CSV file.

The function reads the CSV file located at "data/metadata/trending/trending_videos_metadata.csv", extracts the second column (which contains the video IDs), and returns a slice of strings containing only the unique video IDs.

Returns:

  • A slice of strings representing the unique video IDs in the CSV file.

func SaveJSONToFile

func SaveJSONToFile(filepath string, data []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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