plain

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package plain provides the implementation of store.Store interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(dataPath string) store.Store

NewStore returns a new Store. the argument `dataPath` is the file path where write the data. If `dataPath` is empty, the data aren't written to the file.

Types

type Store

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

Store is the implementation of the Store interface with pure golang.

func (*Store) AddCollectorConfiguration added in v0.7.0

func (store *Store) AddCollectorConfiguration(cfg *graylog.CollectorConfiguration) error

AddCollectorConfiguration adds a collector configuration to the store.

func (*Store) AddCollectorConfigurationInput added in v0.7.0

func (store *Store) AddCollectorConfigurationInput(cfgID string, input *graylog.CollectorConfigurationInput) error

AddCollectorConfigurationInput adds a collector configuration input to the store.

func (*Store) AddCollectorConfigurationOutput added in v0.7.0

func (store *Store) AddCollectorConfigurationOutput(cfgID string, output *graylog.CollectorConfigurationOutput) error

AddCollectorConfigurationOutput adds a collector configuration output to the store.

func (*Store) AddCollectorConfigurationSnippet added in v0.7.0

func (store *Store) AddCollectorConfigurationSnippet(cfgID string, snippet *graylog.CollectorConfigurationSnippet) error

AddCollectorConfigurationSnippet adds a collector configuration snippet to the store.

func (*Store) AddDashboard added in v0.4.0

func (store *Store) AddDashboard(dashboard *graylog.Dashboard) error

AddDashboard adds an dashboard to the store.

func (*Store) AddIndexSet

func (store *Store) AddIndexSet(is *graylog.IndexSet) error

AddIndexSet adds an index set to the store.

func (*Store) AddInput

func (store *Store) AddInput(input *graylog.Input) error

AddInput adds an input to the store.

func (*Store) AddRole

func (store *Store) AddRole(role *graylog.Role) error

AddRole adds a new role to the store.

func (*Store) AddStream

func (store *Store) AddStream(stream *graylog.Stream) error

AddStream adds a stream to the store.

func (*Store) AddStreamRule

func (store *Store) AddStreamRule(rule *graylog.StreamRule) error

AddStreamRule adds a stream rule.

func (*Store) AddUser

func (store *Store) AddUser(user *graylog.User) error

AddUser adds a user to the Store.

func (*Store) Authorize

func (store *Store) Authorize(user *graylog.User, scope string, args ...string) (bool, error)

Authorize authorizes the user.

func (*Store) DeleteCollectorConfiguration added in v0.7.0

func (store *Store) DeleteCollectorConfiguration(id string) error

DeleteCollectorConfiguration deletes a collector configuration from the store.

func (*Store) DeleteCollectorConfigurationInput added in v0.7.0

func (store *Store) DeleteCollectorConfigurationInput(cfgID, inputID string) error

DeleteCollectorConfigurationInput deletes a collector configuration input from the store.

func (*Store) DeleteCollectorConfigurationOutput added in v0.7.0

func (store *Store) DeleteCollectorConfigurationOutput(cfgID, outputID string) error

DeleteCollectorConfigurationOutput deletes a collector configuration output from the store.

func (*Store) DeleteCollectorConfigurationSnippet added in v0.7.0

func (store *Store) DeleteCollectorConfigurationSnippet(cfgID, snippetID string) error

DeleteCollectorConfigurationSnippet deletes a collector configuration snippet from the store.

func (*Store) DeleteDashboard added in v0.4.0

func (store *Store) DeleteDashboard(id string) error

DeleteDashboard deletes an dashboard from the store.

func (*Store) DeleteIndexSet

func (store *Store) DeleteIndexSet(id string) error

DeleteIndexSet removes a index set from the Mock Server.

func (*Store) DeleteInput

func (store *Store) DeleteInput(id string) error

DeleteInput deletes an input from the store.

func (*Store) DeleteLDAPSetting added in v0.6.0

func (store *Store) DeleteLDAPSetting() error

DeleteLDAPSetting deletes a LDAP Setting from store.

func (*Store) DeleteRole

func (store *Store) DeleteRole(name string) error

DeleteRole deletes a role from store.

func (*Store) DeleteStream

func (store *Store) DeleteStream(id string) error

DeleteStream removes a stream from the store.

func (*Store) DeleteStreamRule

func (store *Store) DeleteStreamRule(streamID, streamRuleID string) error

DeleteStreamRule deletes a stream rule.

func (*Store) DeleteUser

func (store *Store) DeleteUser(name string) error

DeleteUser removes a user from the Store.

func (*Store) GetAlarmCallbacks added in v0.5.0

func (store *Store) GetAlarmCallbacks() ([]graylog.AlarmCallback, int, error)

GetAlarmCallbacks returns alarm callbacks.

func (*Store) GetAlert added in v0.3.0

func (store *Store) GetAlert(id string) (*graylog.Alert, error)

GetAlert returns an alert.

func (*Store) GetAlertConditions added in v0.2.0

func (store *Store) GetAlertConditions() ([]graylog.AlertCondition, int, error)

GetAlertConditions returns Alert Conditions.

func (*Store) GetAlerts added in v0.3.0

func (store *Store) GetAlerts(since, limit int) ([]graylog.Alert, int, error)

GetAlerts returns Alerts.

func (*Store) GetCollectorConfiguration added in v0.7.0

func (store *Store) GetCollectorConfiguration(id string) (*graylog.CollectorConfiguration, error)

GetCollectorConfiguration returns an input.

func (*Store) GetCollectorConfigurations added in v0.7.0

func (store *Store) GetCollectorConfigurations() ([]graylog.CollectorConfiguration, int, error)

GetCollectorConfigurations returns all collector configurations.

func (*Store) GetDashboard added in v0.4.0

func (store *Store) GetDashboard(id string) (*graylog.Dashboard, error)

GetDashboard returns an dashboard.

func (*Store) GetDashboards added in v0.4.0

func (store *Store) GetDashboards() ([]graylog.Dashboard, int, error)

GetDashboards returns dashboards.

func (*Store) GetDefaultIndexSetID

func (store *Store) GetDefaultIndexSetID() (string, error)

GetDefaultIndexSetID returns a default index set id.

func (*Store) GetEnabledStreams

func (store *Store) GetEnabledStreams() ([]graylog.Stream, int, error)

GetEnabledStreams returns all enabled streams.

func (*Store) GetIndexSet

func (store *Store) GetIndexSet(id string) (*graylog.IndexSet, error)

GetIndexSet returns an index set.

func (*Store) GetIndexSetStats

func (store *Store) GetIndexSetStats(id string) (*graylog.IndexSetStats, error)

GetIndexSetStats returns an index set stats.

func (*Store) GetIndexSetStatsMap

func (store *Store) GetIndexSetStatsMap() (map[string]graylog.IndexSetStats, error)

GetIndexSetStatsMap returns all of index set stats.

func (*Store) GetIndexSets

func (store *Store) GetIndexSets(skip, limit int) ([]graylog.IndexSet, int, error)

GetIndexSets returns a list of all index sets.

func (*Store) GetInput

func (store *Store) GetInput(id string) (*graylog.Input, error)

GetInput returns an input.

func (*Store) GetInputs

func (store *Store) GetInputs() ([]graylog.Input, int, error)

GetInputs returns inputs.

func (*Store) GetLDAPSetting added in v0.6.0

func (store *Store) GetLDAPSetting() (*graylog.LDAPSetting, error)

GetLDAPSetting returns a LDAP Setting.

func (*Store) GetRole

func (store *Store) GetRole(name string) (*graylog.Role, error)

GetRole returns a Role. If no role with given name is found, returns nil and not returns an error.

func (*Store) GetRoles

func (store *Store) GetRoles() ([]graylog.Role, int, error)

GetRoles returns Roles.

func (*Store) GetStream

func (store *Store) GetStream(id string) (*graylog.Stream, error)

GetStream returns a stream.

func (*Store) GetStreamRule

func (store *Store) GetStreamRule(streamID, streamRuleID string) (*graylog.StreamRule, error)

GetStreamRule returns a stream rule.

func (*Store) GetStreamRules

func (store *Store) GetStreamRules(id string) ([]graylog.StreamRule, int, error)

GetStreamRules returns stream rules of the given stream.

func (*Store) GetStreams

func (store *Store) GetStreams() ([]graylog.Stream, int, error)

GetStreams returns a list of all streams.

func (*Store) GetTotalIndexSetStats

func (store *Store) GetTotalIndexSetStats() (*graylog.IndexSetStats, error)

GetTotalIndexSetStats returns all index set's statistics.

func (*Store) GetUser

func (store *Store) GetUser(username string) (*graylog.User, error)

GetUser returns a user. If the user is not found, this method returns nil and doesn't raise an error.

func (*Store) GetUserByAccessToken

func (store *Store) GetUserByAccessToken(token string) (*graylog.User, error)

GetUserByAccessToken returns a user name. If the user is not found, this method returns nil and doesn't raise an error.

func (*Store) GetUsers

func (store *Store) GetUsers() ([]graylog.User, error)

GetUsers returns users

func (*Store) HasAlert added in v0.3.0

func (store *Store) HasAlert(id string) (bool, error)

HasAlert returns whether the alert exists.

func (*Store) HasCollectorConfiguration added in v0.7.0

func (store *Store) HasCollectorConfiguration(id string) (bool, error)

HasCollectorConfiguration returns whether the collector configuration exists.

func (*Store) HasCollectorConfigurationInput added in v0.7.0

func (store *Store) HasCollectorConfigurationInput(cfgID, inputID string) (bool, error)

HasCollectorConfigurationInput returns whether the collector configuration input exists.

func (*Store) HasCollectorConfigurationOutput added in v0.7.0

func (store *Store) HasCollectorConfigurationOutput(cfgID, outputID string) (bool, error)

HasCollectorConfigurationOutput returns whether the collector configuration output exists.

func (*Store) HasCollectorConfigurationSnippet added in v0.7.0

func (store *Store) HasCollectorConfigurationSnippet(cfgID, snippetID string) (bool, error)

HasCollectorConfigurationSnippet returns whether the collector configuration snippet exists.

func (*Store) HasDashboard added in v0.4.0

func (store *Store) HasDashboard(id string) (bool, error)

HasDashboard returns whether the dashboard exists.

func (*Store) HasIndexSet

func (store *Store) HasIndexSet(id string) (bool, error)

HasIndexSet returns whether the index set exists.

func (*Store) HasInput

func (store *Store) HasInput(id string) (bool, error)

HasInput returns whether the input exists.

func (*Store) HasRole

func (store *Store) HasRole(name string) (bool, error)

HasRole returns whether the role exists.

func (*Store) HasStream

func (store *Store) HasStream(id string) (bool, error)

HasStream returns whether the stream exists.

func (*Store) HasStreamRule

func (store *Store) HasStreamRule(streamID, streamRuleID string) (bool, error)

HasStreamRule returns whether the stream rule exists.

func (*Store) HasUser

func (store *Store) HasUser(username string) (bool, error)

HasUser returns whether the user exists.

func (*Store) IsConflictIndexPrefix

func (store *Store) IsConflictIndexPrefix(id, prefix string) (bool, error)

IsConflictIndexPrefix returns true if indexPrefix would conflict with an existing index set.

func (*Store) Load

func (store *Store) Load() error

Load reads Mock Server's data from a file.

func (*Store) MarshalJSON

func (store *Store) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the json.Marshaler interface.

func (*Store) RenameCollectorConfiguration added in v0.7.0

func (store *Store) RenameCollectorConfiguration(id, name string) (*graylog.CollectorConfiguration, error)

RenameCollectorConfiguration renames a collector configuration.

func (*Store) Save

func (store *Store) Save() error

Save writes Mock Server's data in a file for persistence.

func (*Store) SetDefaultIndexSetID

func (store *Store) SetDefaultIndexSetID(id string) error

SetDefaultIndexSetID sets a default index set id.

func (*Store) UnmarshalJSON

func (store *Store) UnmarshalJSON(b []byte) error

UnmarshalJSON is the implementation of the json.Unmarshaler interface.

func (*Store) UpdateCollectorConfigurationInput added in v0.7.0

func (store *Store) UpdateCollectorConfigurationInput(cfgID, inputID string, input *graylog.CollectorConfigurationInput) error

UpdateCollectorConfigurationInput updates a collector configuration input.

func (*Store) UpdateCollectorConfigurationOutput added in v0.7.0

func (store *Store) UpdateCollectorConfigurationOutput(cfgID, outputID string, output *graylog.CollectorConfigurationOutput) error

UpdateCollectorConfigurationOutput updates a collector configuration output.

func (*Store) UpdateCollectorConfigurationSnippet added in v0.7.0

func (store *Store) UpdateCollectorConfigurationSnippet(cfgID, snippetID string, snippet *graylog.CollectorConfigurationSnippet) error

UpdateCollectorConfigurationSnippet updates a collector configuration snippet.

func (*Store) UpdateDashboard added in v0.4.0

func (store *Store) UpdateDashboard(dashboard *graylog.Dashboard) error

UpdateDashboard updates an dashboard at the Store. Allowed: title, description

func (*Store) UpdateIndexSet

func (store *Store) UpdateIndexSet(prms *graylog.IndexSetUpdateParams) (*graylog.IndexSet, error)

UpdateIndexSet updates an index set at the Mock Server.

func (*Store) UpdateInput

func (store *Store) UpdateInput(prms *graylog.InputUpdateParams) (*graylog.Input, error)

UpdateInput updates an input at the Store. Required: Title, Type, Attrs Allowed: Global, Node

func (*Store) UpdateLDAPSetting added in v0.6.0

func (store *Store) UpdateLDAPSetting(prms *graylog.LDAPSetting) error

UpdateLDAPSetting updates a LDAP Setting at the store.

func (*Store) UpdateRole

func (store *Store) UpdateRole(name string, prms *graylog.RoleUpdateParams) (*graylog.Role, error)

UpdateRole updates a role at the store.

func (*Store) UpdateStream

func (store *Store) UpdateStream(prms *graylog.StreamUpdateParams) (*graylog.Stream, error)

UpdateStream updates a stream at the store.

func (*Store) UpdateStreamRule

func (store *Store) UpdateStreamRule(prms *graylog.StreamRuleUpdateParams) error

UpdateStreamRule updates a stream rule.

func (*Store) UpdateUser

func (store *Store) UpdateUser(prms *graylog.UserUpdateParams) error

UpdateUser updates a user of the Store. "email", "permissions", "full_name", "password"

Jump to

Keyboard shortcuts

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