lifecycle

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppName    = "ollama app"
	CLIName    = "ollama"
	AppDir     = "/opt/Ollama"
	AppDataDir = "/opt/Ollama"
	// TODO - should there be a distinct log dir?
	UpdateStageDir = "/tmp"
	AppLogFile     = "/tmp/ollama_app.log"
	ServerLogFile  = "/tmp/ollama.log"
	UpgradeLogFile = "/tmp/ollama_update.log"
	Installer      = "OllamaSetup.exe"
)
View Source
var (
	UpdateCheckURLBase  = "https://ollama.com/api/update"
	UpdateDownloaded    = false
	UpdateCheckInterval = 60 * 60 * time.Second
)

Functions

func DoUpgrade

func DoUpgrade(cancel context.CancelFunc, done chan int) error

func DownloadNewRelease

func DownloadNewRelease(ctx context.Context, updateResp UpdateResponse) error

func GetStarted

func GetStarted() error

func InitLogging

func InitLogging()

func IsServerRunning

func IsServerRunning(ctx context.Context) bool

func Run

func Run()

func ShowLogs

func ShowLogs()

func SpawnServer

func SpawnServer(ctx context.Context, command string) (chan int, error)

func StartBackgroundUpdaterChecker

func StartBackgroundUpdaterChecker(ctx context.Context, cb func(string) error)

Types

type UpdateResponse

type UpdateResponse struct {
	UpdateURL     string `json:"url"`
	UpdateVersion string `json:"version"`
}

TODO - maybe move up to the API package?

func IsNewReleaseAvailable

func IsNewReleaseAvailable(ctx context.Context) (bool, UpdateResponse)

Jump to

Keyboard shortcuts

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