rusti

package
v0.0.9-beta Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package rusti provides functionality for managing and installing rust binaries. It includes tools for downloading, setting up environments, and selecting appropriate binaries based on the system architecture and operating system. The package interacts with external Rust releases and handles file system operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

type Binary struct {
	File file.File
	Dir  file.Folder
	Env  Env
}

Binary represents a Rust binary.

func New

func New() (binary Binary, err error)

New creates a new Rust binary.

func (*Binary) CleanUp

func (b *Binary) CleanUp() error

CleanUp removes the temporary directory associated with the binary.

func (*Binary) Download

func (b *Binary) Download(target string) error

Download downloads the Rust binary from the official website.

func (*Binary) Find

func (b *Binary) Find(paths ...string) (file.File, error)

Find searches for the Rust binary in the system PATH and the specified paths.

func (Binary) Latest

func (b Binary) Latest() (string, error)

Latest returns the latest stable version of Rust.

func (Binary) MatchTarget

func (b Binary) MatchTarget(version string) (string, error)

MatchTarget returns the target file name for the Rust binary.

type Env

type Env map[string]string

Env represents the environment variables for a Rust binary.

func (*Env) Append

func (e *Env) Append(env Env)

Append appends the given environment variables to the current environment.

func (*Env) Default

func (e *Env) Default(dir string)

Default sets the default environment variables for a Rust binary.

func (Env) ToSlice

func (e Env) ToSlice() []string

ToSlice converts the environment variables to a slice.

type Installer

type Installer struct {
	Binary Binary
}

func (*Installer) Install

func (i *Installer) Install(path string) (output string, err error)

Jump to

Keyboard shortcuts

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