modelmanager

package
v0.0.0-...-0000000 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package modelmanager defines an API end point for functions dealing with models. Creating, listing and sharing models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSource

type ConfigSource interface {
	Config() (*config.Config, error)
}

ConfigSource describes a type that is able to provide config. Abstracted primarily for testing.

type ModelManager

type ModelManager interface {
	ConfigSkeleton(args params.ModelSkeletonConfigArgs) (params.ModelConfigResult, error)
	CreateModel(args params.ModelCreateArgs) (params.Model, error)
	ListModels(user params.Entity) (params.UserModelList, error)
}

ModelManager defines the methods on the modelmanager API end point.

type ModelManagerAPI

type ModelManagerAPI struct {
	// contains filtered or unexported fields
}

ModelManagerAPI implements the model manager interface and is the concrete implementation of the api end point.

func NewModelManagerAPI

func NewModelManagerAPI(
	st *state.State,
	resources *common.Resources,
	authorizer common.Authorizer,
) (*ModelManagerAPI, error)

NewModelManagerAPI creates a new api server endpoint for managing models.

func (*ModelManagerAPI) ConfigSkeleton

ConfigSkeleton returns config values to be used as a starting point for the API caller to construct a valid model specific config. The provider and region params are there for future use, and current behaviour expects both of these to be empty.

func (*ModelManagerAPI) CreateModel

func (em *ModelManagerAPI) CreateModel(args params.ModelCreateArgs) (params.Model, error)

CreateModel creates a new model using the account and model config specified in the args.

func (*ModelManagerAPI) ListModels

func (em *ModelManagerAPI) ListModels(user params.Entity) (params.UserModelList, error)

ListModels returns the models that the specified user has access to in the current server. Only that controller owner can list models for any user (at this stage). Other users can only ask about their own models.

Source Files

  • modelmanager.go
  • state.go

Jump to

Keyboard shortcuts

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