resource

package
v0.0.0-...-7695c73 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PLUGIN_INDEXER  = 1
	PLUGIN_CRAWLER  = 2
	PLUGIN_SENSOR   = 3
	PLUGIN_SCENARIO = 4
	PLUGIN_PIPELINE = 5
	PLUGIN_HELPER   = 6
)
View Source
const (
	RESOURCE_ORG_LABEL         = "org"
	RESOURCE_ADMIN_LABEL       = "admin"
	RESOURCE_TOKEN_LABEL       = "token"
	RESOURCE_APPLICATION_LABEL = "application"
	RESOURCE_FEED_LABEL        = "feed"
	RESOURCE_ENTRY_LABEL       = "entry"
	RESOURCE_METRIC_LABEL      = "metric"
	RESOURCE_VIEWER_LABEL      = "viewer"
	RESOURCE_WORKFLOW_LABEL    = "workflow"
	RESOURCE_PLUGIN_LABEL      = "plugin"
)

Variables

View Source
var (
	Orgs         map[string]*Org
	Admins       map[string]*Admin
	Tokens       map[string]*Token
	Applications map[string]*Application
	Feeds        map[string]*Feed
	Entries      map[string]*Entry
	Metrics      map[string]*Metric
	Viewers      map[string]*Viewer
	Workflows    map[string]*Workflow
	Plugins      map[string]*Plugin
)

Functions

func ActionEmptyFeed

func ActionEmptyFeed(id string)

func ActionReloadFeed

func ActionReloadFeed(id string)

func AddAdmin

func AddAdmin(admin Admin, orgId string) (id string, err error)

func AddApplication

func AddApplication(application Application, orgId string) (id string, err error)

func AddEntry

func AddEntry(feedEntry Entry, FeedId string, ApplicationId string, OrgId string) (EntryId string, err error)

func AddFeed

func AddFeed(feed Feed, applicationId string, orgId string) (id string, err error)

func AddOrg

func AddOrg(org *Org) (err error)

func AddOrgToken

func AddOrgToken(token Token, orgId string) (id string, err error)

func AddPlugin

func AddPlugin(plugin *Plugin) (err error)

func AddToken

func AddToken(token Token, adminId string, orgId string) (id string, err error)

func AddTokenForOrganisation

func AddTokenForOrganisation(token Token, orgId string) (id string, err error)

func AddWorkflow

func AddWorkflow(feedWorkflow Workflow, FeedId string, ApplicationId string, OrgId string) (WorkflowId string, err error)

func Contains

func Contains(s []string, e string) bool

func ConvertInterfaceToStringArray

func ConvertInterfaceToStringArray(d interface{}) []string

func DeleteAdmin

func DeleteAdmin(id string) error

func DeleteApplication

func DeleteApplication(id string) error

func DeleteEntry

func DeleteEntry(id string, FeedId string, ApplicationId string, OrgId string) error

func DeleteFeed

func DeleteFeed(id string) error

func DeleteOrg

func DeleteOrg(id string) error

func DeletePlugin

func DeletePlugin(id string) error

func DeleteToken

func DeleteToken(id string) error

func DeleteWorkflow

func DeleteWorkflow(id string, FeedId string, ApplicationId string, OrgId string) error

func InitResources

func InitResources()

func InitStorage

func InitStorage()

func NewResourceManager

func NewResourceManager(engine emodel.Elasticfeed) emodel.ResourceManager

func UpdateAdmin

func UpdateAdmin(id string, data string) (err error)

func UpdateApplication

func UpdateApplication(id string, data string) (err error)

func UpdateEntry

func UpdateEntry(id string, FeedId string, ApplicationId string, OrgId string, data string) (err error)

func UpdateFeed

func UpdateFeed(id string, data string) (err error)

func UpdateOrg

func UpdateOrg(org *Org) (err error)

func UpdatePlugin

func UpdatePlugin(plugin *Plugin) (err error)

func UpdateToken

func UpdateToken(id string, data string) (err error)

Types

type Admin

type Admin struct {
	Id  string
	Org *Org

	Username   string
	Maintainer bool
	Whitelist  []string
	Data       string

	Tokens int
}

func FindAdminByUsername

func FindAdminByUsername(username string) (admin *Admin, err error)

func GetAdmin

func GetAdmin(id string, OrgId string) (admin *Admin, err error)

func GetAdminList

func GetAdminList(OrgId string) (adminList []*Admin, err error)

func (*Admin) IsMaintainer

func (this *Admin) IsMaintainer() bool

func (*Admin) IsSuperUser

func (this *Admin) IsSuperUser() bool

func (*Admin) IsWhitelisted

func (this *Admin) IsWhitelisted(ip string) bool

type Application

type Application struct {
	Id    string
	Org   *Org
	Data  string
	Feeds int
}

func GetApplication

func GetApplication(id string, orgId string) (application *Application, err error)

func GetApplicationList

func GetApplicationList(orgId string) (appList []*Application, err error)

func (*Application) AddFeed

func (this *Application) AddFeed(feed Feed) (id string, err error)

func (*Application) GetFeed

func (this *Application) GetFeed(id string) (feed *Feed, err error)

func (*Application) GetFeedList

func (this *Application) GetFeedList() ([]*Feed, error)

type Entry

type Entry struct {
	Id   string
	Feed *Feed
	Data string
}

func GetEntry

func GetEntry(id string, FeedId string, ApplicationId string, OrgId string) (feedEntry *Entry, err error)

func GetEntryList

func GetEntryList(FeedId string, ApplicationId string, OrgId string) (feedEntries []*Entry, err error)

type Feed

type Feed struct {
	Id          string
	Application *Application
	Data        string

	Entries   int
	Workflows int
}

func GetFeed

func GetFeed(id string, applicationId string, orgId string) (feed *Feed, err error)

func GetFeedList

func GetFeedList(ApplicationId string, OrgId string) (feedList []*Feed, err error)

func NewFeed

func NewFeed(id string, app *Application, data string, entries int, workflows int) *Feed

func (*Feed) AddEntry

func (this *Feed) AddEntry(entry Entry) (EntryId string, err error)

func (*Feed) AddWorkflow

func (this *Feed) AddWorkflow(workflow Workflow) (WorkflowId string, err error)

func (*Feed) GetEntryList

func (this *Feed) GetEntryList() (entries []*Entry, err error)

func (*Feed) GetWorkflow

func (this *Feed) GetWorkflow() *Workflow

func (*Feed) GetWorkflowList

func (this *Feed) GetWorkflowList() (entries []*Workflow, err error)

type Metric

type Metric struct{}

func (*Metric) NewMetric

func (this *Metric) NewMetric() *Metric

type Org

type Org struct {
	Id   string
	Name string
	Data string

	Tokens       int
	Admins       int
	Applications int
}

func GetOrg

func GetOrg(id string) (org *Org, err error)

func GetOrgList

func GetOrgList() (orgList []*Org, err error)

func (*Org) AddApplication

func (this *Org) AddApplication(app Application) (id string, err error)

func (*Org) AssignAdmin

func (this *Org) AssignAdmin(adminId int) bool

type Plugin

type Plugin struct {
	Id      string
	Name    string
	Group   string
	Version string
	Path    string
	License string
}

func GetPlugin

func GetPlugin(id string) (plugin *Plugin, err error)

func GetPluginList

func GetPluginList() (pluginList []*Plugin, err error)

func NewPlugin

func NewPlugin(id string, name string, group string, version string, path string, license string) *Plugin

type ResourceManager

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

func (*ResourceManager) GetEngine

func (this *ResourceManager) GetEngine() emodel.Elasticfeed

func (*ResourceManager) GetStreamService

func (this *ResourceManager) GetStreamService() *stream.StreamService

func (*ResourceManager) Init

func (this *ResourceManager) Init()

type Token

type Token struct {
	Id    string
	Admin *Admin
	Data  string
}

func GetOrgToken

func GetOrgToken(id string, orgId string) (org *Token, err error)

func GetOrgTokenList

func GetOrgTokenList(orgId string) (orgList []*Token, err error)

func GetToken

func GetToken(id string, AdminId string, OrgId string) (token *Token, err error)

func GetTokenList

func GetTokenList(AdminId string, OrgId string) (tokenLinst []*Token, err error)

type Viewer

type Viewer struct{}

func (*Viewer) GetContext

func (this *Viewer) GetContext()

func (*Viewer) GetId

func (this *Viewer) GetId()

func (*Viewer) GetIdentity

func (this *Viewer) GetIdentity()

func (*Viewer) GetNN

func (this *Viewer) GetNN()

func (*Viewer) GetPluginStorageList

func (this *Viewer) GetPluginStorageList()

func (*Viewer) GetProfile

func (this *Viewer) GetProfile()

func (*Viewer) GetScope

func (this *Viewer) GetScope()

func (*Viewer) GetStorage

func (this *Viewer) GetStorage()

type Workflow

type Workflow struct {
	Id      string
	Feed    *Feed
	Default bool
	Data    string
}

func GetWorkflow

func GetWorkflow(id string, FeedId string, ApplicationId string, OrgId string) (feedWorkflow *Workflow, err error)

func GetWorkflowList

func GetWorkflowList(FeedId string, ApplicationId string, OrgId string) (feedWorkflows []*Workflow, err error)

func NewWorkflow

func NewWorkflow(id string, feed *Feed, def bool, data string) *Workflow

func UpdateWorkflow

func UpdateWorkflow(id string, FeedId string, ApplicationId string, OrgId string, data string) (workflow *Workflow, err error)

func (*Workflow) GetProfilerRawData

func (this *Workflow) GetProfilerRawData() map[string]string

func (*Workflow) GetRawData

func (this *Workflow) GetRawData() map[string]interface{}

Jump to

Keyboard shortcuts

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