utils

package
v0.0.0-...-3d92ad3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenAIClient *openai.Client
View Source
var RequestLimiter *rate.Limiter
View Source
var ToeknLimiter *rate.Limiter

Functions

func Polish

func Polish(path string) error

Polish a doc

func SplitDoc

func SplitDoc(docContext string) []string

func Translate

func Translate(docPath string, lang string) error

Translate a doc to another language

func Wait

func Wait(tokenNumber int) (err error)

Types

type WorkQueue

type WorkQueue struct {
	Item []string
	// contains filtered or unexported fields
}

func (*WorkQueue) AddToFailedList

func (q *WorkQueue) AddToFailedList(path string)

AddToFailedList add a doc to the failed list

func (*WorkQueue) Empty

func (q *WorkQueue) Empty() bool

Empty judge whether the queue is Empty

func (*WorkQueue) GetFileList

func (q *WorkQueue) GetFileList(docDir string) error

GetFileList get all doc in the docs directory

func (*WorkQueue) Pop

func (q *WorkQueue) Pop() string

Pop a doc from the work queue

func (*WorkQueue) PrintFileList

func (q *WorkQueue) PrintFileList()

func (*WorkQueue) Push

func (q *WorkQueue) Push(path string)

Push a doc to the work queue

Jump to

Keyboard shortcuts

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