dashboards

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Overview

Package dashboards is a generated protocol buffer package.

It is generated from these files:

github.com/appcelerator/amp/data/dashboards/dashboards.proto

It has these top-level messages:

Dashboard

Index

Constants

View Source
const (
	InvalidName   = Error("name is invalid")
	AlreadyExists = Error("dashboard already exists")
	NotFound      = Error("dashboard not found")
)

Errors

Variables

This section is empty.

Functions

func CheckName

func CheckName(name string) (string, error)

CheckName checks name

Types

type Dashboard

type Dashboard struct {
	Id       string            `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Name     string            `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Owner    *accounts.Account `protobuf:"bytes,3,opt,name=owner" json:"owner,omitempty"`
	CreateDt int64             `protobuf:"varint,4,opt,name=create_dt,json=createDt" json:"create_dt,omitempty"`
	Data     string            `protobuf:"bytes,5,opt,name=data" json:"data,omitempty"`
}

func (*Dashboard) Descriptor

func (*Dashboard) Descriptor() ([]byte, []int)

func (*Dashboard) GetCreateDt

func (m *Dashboard) GetCreateDt() int64

func (*Dashboard) GetData

func (m *Dashboard) GetData() string

func (*Dashboard) GetId

func (m *Dashboard) GetId() string

func (*Dashboard) GetName

func (m *Dashboard) GetName() string

func (*Dashboard) GetOwner

func (m *Dashboard) GetOwner() *accounts.Account

func (*Dashboard) ProtoMessage

func (*Dashboard) ProtoMessage()

func (*Dashboard) Reset

func (m *Dashboard) Reset()

func (*Dashboard) String

func (m *Dashboard) String() string

func (*Dashboard) Validate

func (f *Dashboard) Validate() (err error)

Validate validates Dashboard

type Error

type Error string

Error type

func (Error) Error

func (e Error) Error() string

type Interface

type Interface interface {
	// Create creates a new dashboard
	Create(ctx context.Context, name string, data string) (dashboard *Dashboard, err error)

	// Get fetches a dashboard by id
	Get(ctx context.Context, id string) (dashboard *Dashboard, err error)

	// GetByName fetches a dashboard by name
	GetByName(ctx context.Context, name string) (dashboard *Dashboard, err error)

	// List lists dashboards
	List(ctx context.Context) (dashboards []*Dashboard, err error)

	// UpdateName renames the given dashboard
	UpdateName(ctx context.Context, id string, name string) (err error)

	// UpdateData updates the given dashboard data
	UpdateData(ctx context.Context, id string, data string) (err error)

	// Delete deletes a dashboard by id
	Delete(ctx context.Context, id string) (err error)

	// Reset resets the dashboard storage
	Reset(ctx context.Context)
}

Interface defines the dashboard data access layer

type Store

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

Store implements dashboard data.Interface

func NewStore

func NewStore(storage storage.Interface, accounts accounts.Interface) *Store

NewStore returns an etcd implementation of dashboards.Interface

func (*Store) Create

func (s *Store) Create(ctx context.Context, name string, data string) (dashboard *Dashboard, err error)

Create creates a new dashboard

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

Delete deletes a dashboard by id

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (*Dashboard, error)

Get fetches a dashboard by id

func (*Store) GetByName

func (s *Store) GetByName(ctx context.Context, name string) (dashboard *Dashboard, err error)

GetByName fetches a dashboard by name

func (*Store) List

func (s *Store) List(ctx context.Context) ([]*Dashboard, error)

List lists dashboards

func (*Store) Reset

func (s *Store) Reset(ctx context.Context)

Reset resets the account storage

func (*Store) UpdateData

func (s *Store) UpdateData(ctx context.Context, id string, data string) error

UpdateData updates the given dashboard data

func (*Store) UpdateName

func (s *Store) UpdateName(ctx context.Context, id string, name string) error

UpdateName renames the given dashboard

Jump to

Keyboard shortcuts

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