New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/sthussey/timeline

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sthussey/timeline

  • v0.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Testing Badge Linting Badge

timeline

Library for executing a serialized event sequence

Summary

This is a simple library that can generate a described sequence of events to allow for testing of code response.

The library comes packaged with a few event types and the user can map additional actions and synchronizers for timeline to execute.

Sequence

A timeline sequence is composed of events that are either synchornizers or actions. Synchronizers indicate timeline should synchornize the event flow with something such as an OS signal or a timer expiration. Actions simply call functions in your code base.

Example

  timeline:
    - sync: SignalRecv
      inputs:
        signal: SIGUSR1
    - action: NetworkBlock
      block: true
      inputs:
        dest: 10.0.0.1/32
    - sync: TimerWait
      inputs:
        duration: 30s
    - action: NetworkAllow
      block: false
      inputs:
        dest: 10.0.0.1/32 

The above serialization indicates a timeline that will wait until the executable receives the SIGUSR1 signal and then execute a function the user has mapped to NetworkBlock passing the inputs object as a parameter. It will block until that function returns and then the timeline will wait idly for 30s before calling the function for NetworkAllow.

Packaged Event Types

Technically there is little difference between an action and a synchronizer. The serialization only differentiates them to reason about the intent of the timeline.

Synchronizers

Synchronizers are functions that work to synchronize the timeline with external or environmental conditions.

SignalRecv

Synchronize the timeline execution with OS signals that are sent to the rcon process. This could used to synchronize an external measurement or testing system with described changes made to the runtime context.

TimerWait

This is a basic timer to pause execution of the timeline for a static amount of time described as a Go ParseDuration format.

Actions

Actions are functions that can be used to change the runtime context. This could be to emulate failed network connectivity, change the contents of a file, or just have rcon log a message.

LogMessage

FAQs

Package last updated on 18 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc