mongodb

package
v0.0.0-...-82ed53c Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: UPL-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreType = "mongodb"

	//Following are keys of mongodb store properties
	MongoURIKey          = "MongoURI"
	MongoDatabaseNameKey = "MongoDatabase"

	MongoURIFlag          = "mongostore_uri"
	MongoDatabaseNameFlag = "mongostore_database"

	//default property values
	DefaultURI          = "mongodb://localhost:27017"
	DefaultDatabaseName = "speedleplus"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoStoreBuilder

type MongoStoreBuilder struct{}

func (MongoStoreBuilder) GetStoreParams

func (msb MongoStoreBuilder) GetStoreParams() map[string]string

func (MongoStoreBuilder) NewStore

func (msb MongoStoreBuilder) NewStore(config map[string]interface{}) (pms.PolicyStoreManager, error)

type Store

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

func (*Store) CreateFunction

func (s *Store) CreateFunction(function *pms.Function) (*pms.Function, error)

func (*Store) CreatePolicy

func (s *Store) CreatePolicy(serviceName string, policy *pms.Policy) (*pms.Policy, error)

func (*Store) CreateRolePolicy

func (s *Store) CreateRolePolicy(serviceName string, rolePolicy *pms.RolePolicy) (*pms.RolePolicy, error)

func (*Store) CreateService

func (s *Store) CreateService(service *pms.Service) error

CreateService creates a new service

func (*Store) DeleteFunction

func (s *Store) DeleteFunction(funcName string) error

func (*Store) DeleteFunctions

func (s *Store) DeleteFunctions() error

func (*Store) DeletePolicies

func (s *Store) DeletePolicies(serviceName string) error

func (*Store) DeletePolicy

func (s *Store) DeletePolicy(serviceName string, id string) error

func (*Store) DeleteRolePolicies

func (s *Store) DeleteRolePolicies(serviceName string) error

func (*Store) DeleteRolePolicy

func (s *Store) DeleteRolePolicy(serviceName string, id string) error

func (*Store) DeleteService

func (s *Store) DeleteService(serviceName string) error

DeleteService deletes a service named ${serviceName} from a file

func (*Store) DeleteServices

func (s *Store) DeleteServices() error

DeleteServices deletes all services from a file

func (*Store) GetFunction

func (s *Store) GetFunction(funcName string) (*pms.Function, error)

func (*Store) GetFunctionCount

func (s *Store) GetFunctionCount() (int64, error)

func (*Store) GetPolicy

func (s *Store) GetPolicy(serviceName string, id string) (*pms.Policy, error)

func (*Store) GetPolicyAndRolePolicyCounts

func (s *Store) GetPolicyAndRolePolicyCounts() (map[string]*pms.PolicyAndRolePolicyCount, error)

GetPolicyAndRolePolicyCounts returns a map, in which the key is the service name, and the value is the count of both policies and role policies in the service.

func (*Store) GetPolicyCount

func (s *Store) GetPolicyCount(serviceName string) (int64, error)

func (*Store) GetRolePolicy

func (s *Store) GetRolePolicy(serviceName string, id string) (*pms.RolePolicy, error)

func (*Store) GetRolePolicyCount

func (s *Store) GetRolePolicyCount(serviceName string) (int64, error)

func (*Store) GetService

func (s *Store) GetService(serviceName string) (*pms.Service, error)

GetService gets the detailed info of a service

func (*Store) GetServiceCount

func (s *Store) GetServiceCount() (int64, error)

GetServiceCount gets the service count

func (*Store) GetServiceNames

func (s *Store) GetServiceNames() ([]string, error)

GetServiceNames reads all the service names

func (*Store) ListAllFunctions

func (s *Store) ListAllFunctions(filter string) ([]*pms.Function, error)

func (*Store) ListAllPolicies

func (s *Store) ListAllPolicies(serviceName string, filter string) ([]*pms.Policy, error)

For policy manager

func (*Store) ListAllRolePolicies

func (s *Store) ListAllRolePolicies(serviceName string, filter string) ([]*pms.RolePolicy, error)

For role policy manager

func (*Store) ListAllServices

func (s *Store) ListAllServices() ([]*pms.Service, error)

ListAllServices lists all the services

func (*Store) ReadPolicyStore

func (s *Store) ReadPolicyStore() (*pms.PolicyStore, error)

ReadPolicyStore reads policy store from a file

func (*Store) StopWatch

func (s *Store) StopWatch()

func (*Store) Type

func (s *Store) Type() string

func (*Store) Watch

func (s *Store) Watch() (pms.StorageChangeChannel, error)

func (*Store) WritePolicyStore

func (s *Store) WritePolicyStore(ps *pms.PolicyStore) error

WritePolicyStore writes policies to a file

Jump to

Keyboard shortcuts

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