util

package
v0.27.3-beta Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDataFrameToMarkdownTable

func ConvertDataFrameToMarkdownTable(rows [][]string) string

func DecodeBase64

func DecodeBase64(input string) ([]byte, error)

DecodeBase64 takes a base64-encoded blob, trims the MIME type (if present) and decodes the remaining bytes.

func GetContentTypeFromBase64

func GetContentTypeFromBase64(base64String string) (string, error)

func GetDomainFromURL

func GetDomainFromURL(urlStr string) (string, error)

func GetFileBase64Content

func GetFileBase64Content(base64String string) string

func GetFileExt

func GetFileExt(fileData []byte) string

func GetFileType

func GetFileType(base64String, filename string) (string, error)

func GetFileTypeByFilename

func GetFileTypeByFilename(filename string) (string, error)

func GetHeaderAuthorization

func GetHeaderAuthorization(vars map[string]any) string

func GetInstillRequesterUID

func GetInstillRequesterUID(vars map[string]any) string

func GetInstillUserUID

func GetInstillUserUID(vars map[string]any) string

func ScrapeWebpageDescription

func ScrapeWebpageDescription(doc *goquery.Document) string

ScrapeWebpageDescription extracts and returns the description from the *goquery.Document. If the description does not exist, an empty string is returned The description is found by looking for the meta tag with the name "description" and returning the content attribute

func ScrapeWebpageHTML

func ScrapeWebpageHTML(doc *goquery.Document) (string, error)

ScrapeWebpageHTML scrape the HTML content of a webpage

func ScrapeWebpageHTMLToMarkdown

func ScrapeWebpageHTMLToMarkdown(html, domain string) (string, error)

ScrapeWebpageHTMLToMarkdown converts an HTML string to Markdown format

func ScrapeWebpageTitle

func ScrapeWebpageTitle(doc *goquery.Document) string

ScrapeWebpageTitle extracts and returns the title from the *goquery.Document

func StripProtocolFromURL

func StripProtocolFromURL(url string) string

func TransformContentTypeToFileExtension

func TransformContentTypeToFileExtension(contentType string) string

func WriteField

func WriteField(writer *multipart.Writer, key string, value string)

func WriteFile

func WriteFile(writer *multipart.Writer, fileName string, fileData []byte) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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