internal

package
v0.0.0-...-3a8f18d Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveUser

func ResolveUser(event SymEvent) (string, error)

ResolveUser is a placeholder that takes the incoming user from the Sym event and resolves to the right user id for the system you're escalating the user in.

func UpdateUser

func UpdateUser(username string, event SymEvent) (string, error)

UpdateUser is a placeholder to handle updating the given username based on the event type

Types

type SymActor

type SymActor struct {
	Username string `json:"username"`
}

SymActor has metadata on the user that initiated the Sym Event

type SymEvent

type SymEvent struct {
	Actor   *SymActor        `json:"actor"`
	Details *SymEventDetails `json:"event"`
	Run     *SymRun          `json:"run"`
}

Starter model for Sym events, just including the username and event type properties that are required by our example Lambda implementation. For more details on the event object format, refer to our reporting docs: https://docs.symops.com/docs/reporting

type SymEventDetails

type SymEventDetails struct {
	Type string `json:"type"`
}

SymEventDetails has data on the kind of event this is

type SymResult

type SymResult struct {
	Body   map[string]interface{} `json:"body"`
	Errors []string               `json:"errors"`
}

Sym expects your Lambda implementation to return an object a body that can be empty or can include messages your Sym workflow handler processes. The object can also return error messages that will be surfaced to the user and Sym implementer.

func HandleSymEvent

func HandleSymEvent(event SymEvent) (*SymResult, error)

HandleSymEvent includes placeholders to resolve the user and handle escalation/deescalation.

func ResultForError

func ResultForError(err error) *SymResult

ResultForError creates a SymResult payload for an error message

type SymRun

type SymRun struct {
	Actors map[string]SymActor `json:"actors"`
}

SymRun contains metadata on the run of this workflow

Jump to

Keyboard shortcuts

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