tree

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PatchKeyValueSlice

func PatchKeyValueSlice(slice []string, mode, key, value string) []string

PatchKeyValueSlice is a helper function that makes working with key/value pairs easier.

func PluginMain

func PluginMain(i Plugin)

PluginMain is called with an interface to serve as the plugin. This function never returns.

Types

type NullPlugin

type NullPlugin struct{}

NullPlugin represents a plugin with no behavior at all. The intent is that it can be embedded into real plugins to stub out the functions that the plugin does not wish to implement.

func (NullPlugin) EntityCreate

func (NullPlugin) EntityCreate(e, de pb.Entity) (pb.Entity, error)

EntityCreate is called after an entity has been fully created, but before the entity has been written to disk. This hook is an excellent time to create entities in other systems.

func (NullPlugin) EntityDestroy

func (NullPlugin) EntityDestroy(e pb.Entity) (pb.Entity, error)

EntityDestroy is called when an entity is being completely removed from the system. At this point in the call chain the entity has not been fully removed, but removal will continue if no errors are encountered in the processing chain.

func (NullPlugin) EntityLock

func (NullPlugin) EntityLock(e pb.Entity) (pb.Entity, error)

EntityLock is called after the lock flag has been set on an entity, but before the updated entity has been written to disk. This call is the appropriate point to lock entities in other systems if locks are propogated.

func (NullPlugin) EntityUnlock

func (NullPlugin) EntityUnlock(e pb.Entity) (pb.Entity, error)

EntityUnlock is called after the lock flag has been cleared for an entity. This call should be used to propagate entity unlocks to other systems.

func (NullPlugin) EntityUpdate

func (NullPlugin) EntityUpdate(e pb.Entity) (pb.Entity, error)

EntityUpdate is called after an entity update has occurred, but before the updated entity has been written to disk. This call is the appropriate time to update metadata in other systems if it has been changed.

func (NullPlugin) GroupCreate

func (NullPlugin) GroupCreate(g pb.Group) (pb.Group, error)

GroupCreate is called when a group has been created, but not yet written to the storage backend. This call can be used to create matching groups in remote systems.

func (NullPlugin) GroupDestroy

func (NullPlugin) GroupDestroy(g pb.Group) (pb.Group, error)

GroupDestroy is called while a group is being fully removed from the server. Groups should never be fully removed, but if they are to be destroyed then this function will allow you to propagate this destruction to other systems.

func (NullPlugin) GroupUpdate

func (NullPlugin) GroupUpdate(g pb.Group) (pb.Group, error)

GroupUpdate is called when the metadata on a group has been updated. If propogating group memberships to another system, a periodic approach is recommended, as that will be much cleaner than trying to watch for updates and trigger scans dynamically.

func (NullPlugin) PostAuthCheck

func (NullPlugin) PostAuthCheck(e, de pb.Entity) (pb.Entity, error)

PostAuthCheck is called after an entity has successfully authenticated. This method will not be called in the event of an authentication failure.

func (NullPlugin) PostSecretChange

func (NullPlugin) PostSecretChange(e, de pb.Entity) (pb.Entity, error)

PostSecretChange is called after a secret change has occurred, but before it is committed to permanent storage.

func (NullPlugin) PreAuthCheck

func (NullPlugin) PreAuthCheck(e, de pb.Entity) (pb.Entity, error)

PreAuthCheck is called before an entity has successfully authenticated.

func (NullPlugin) PreSecretChange

func (NullPlugin) PreSecretChange(e, de pb.Entity) (pb.Entity, error)

PreSecretChange change is called before an entity has completed a secret change, but after the request has been authenticated.

type Plugin

type Plugin = common.Plugin

Plugin is an alias to an internal type that all tree modifying plugins must satisfy.

Jump to

Keyboard shortcuts

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