secinfo

command module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

Secinfo

Go Reference Go Report Card

This is code in Golang that will read a csv file and generate updated markdown files to be displayed on https://github.com/infosecstreams/infosecstreams.github.io/

Development

Check the Makefile for all options but you've got make {docs,test,cover,clean,build,docker-build,docker-run} available to you.

When running docker-run, we assume you're providing streamers.csv from the infosecstreams repo. You can check the invocation of the docker run ... command in the Makefile for further details.

Test Mode

When developing, you'll likely not want to actually hit the API and use the internet. Instead you can reference static json files.

If the SECINFO_TEST environment variable is set (to literally any non-empty string), we'll use the test files instead of hitting the API.

// Check environ SECINFO_TEST exists
if os.Getenv("SECINFO_TEST") == "" { ... }
else {
  // Read active.json into active struct
  f, _ := ioutil.ReadFile("active.json")
  _ = json.Unmarshal([]byte(f), &active)
  // Read inactive.json into inactive struct
  f, _ = ioutil.ReadFile("inactive.json")
  _ = json.Unmarshal([]byte(f), &inactive)
}

Usage

Ensure there's a streamers.csv in the CWD of the secinfo binary. You can optionally provide an existing index.md file to be updated The tool should do its best to main the online/offline status during the update.

This is ideally ran in the infosecstreams repo as part of a time-based GitHub Actions workflow. That workflow should run that docker container generated by this repo.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package streamers extracts 30-day streaming statistics and generates sorted markdown.
Package streamers extracts 30-day streaming statistics and generates sorted markdown.

Jump to

Keyboard shortcuts

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