model

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package model implements model storage/deployment client.

Index

Constants

This section is empty.

Variables

View Source
var ViamModelDotDir = filepath.Join(os.Getenv("HOME"), ".viam", "models")

ViamModelDotDir is the default model directory a model will deployed into, unless otherwise specified.

Functions

func NewClient

func NewClient(conn rpc.ClientConn) v1.ModelServiceClient

NewClient constructs a new pb.ModelServiceClient using the passed in connection.

func NewConnection

func NewConnection(logger *zap.SugaredLogger, address string, rpcOpts []rpc.DialOption) (rpc.ClientConn, error)

NewConnection builds a connection to the passed address with the passed rpcOpts.

Types

type Manager

type Manager interface {
	DownloadModels(cfg *config.Config, modelsToDeploy []*Model, errorChannel chan error)
	Close()
}

Manager is responsible for deploying model files.

func NewDefaultManager

func NewDefaultManager(logger golog.Logger, cfg *config.Config) (Manager, error)

NewDefaultManager returns the default Manager that syncs data to app.viam.com.

func NewManager

func NewManager(logger golog.Logger, partID string, client v1.ModelServiceClient,
	conn rpc.ClientConn, httpClient httpClient,
) (Manager, error)

NewManager returns a new model Manager.

type ManagerConstructor

type ManagerConstructor func(logger golog.Logger, cfg *config.Config) (Manager, error)

ManagerConstructor is a function for building a Manager.

type Model

type Model struct {
	Name        string `json:"source_model_name"`
	Destination string `json:"destination"`
}

Model describes a model we want to download to the robot.

Jump to

Keyboard shortcuts

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