hoofli

package module
v0.1.1 Latest Latest
Warning

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

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

README

hoofli

Generate PlantUML diagrams from Chrome or Firefox network inspections

GitHub release (latest SemVer) GitHub Workflow Status report card godoc

GitHub watchers GitHub stars Twitter URL

This tool reads browser HAR files stored on your local disk and transforms them into PlantUML formatted files. You will need to download PlantUML from https://plantuml.com/ or use the package management tool of your choice

Installing
$ go install github.com/dnnrly/hoofli/cmd/hoofli
Running Unit Tests
$ make test
Running Acceptance tests
$ make deps
$ make build acceptance-test

Important make targets

  • install -- install hoofli from the current working tree
  • build -- build hoofli
  • clean -- remove build artifacts from the working tree
  • clean-deps -- remove dependencies in the working tree
  • test-deps -- ci target - install test dependencies
  • build-deps -- ci target - install build dependencies
  • deps -- ci target - install build and tets dependencies
  • test -- run unit tests with tparse prettyfying
  • acceptance-test -- run acceptance tests on built hoofli
  • ci-test -- ci target - run unit tests
  • lint -- run linting
  • release -- ci target - release hoofli
  • update -- update dependencies
  • help -- Show this help.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Pascal Dennerly - Initial work - dnnrly

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

  • Important people here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Afterrequest struct {
		Expires      string `json:"expires"`
		Lastfetched  string `json:"lastFetched"`
		Etag         string `json:"eTag"`
		Fetchcount   string `json:"fetchCount"`
		Datasize     string `json:"_dataSize"`
		Lastmodified string `json:"_lastModified"`
		Device       string `json:"_device"`
	} `json:"afterRequest"`
}

type Content

type Content struct {
	Mimetype string `json:"mimeType"`
	Size     int    `json:"size"`
	Text     string `json:"text"`
}

type Entries

type Entries []Entry

func (Entries) ExcludeByResponseHeader

func (e Entries) ExcludeByResponseHeader(header, value string) Entries

func (Entries) ExcludeByURL

func (e Entries) ExcludeByURL(pattern string) Entries

type Entry

type Entry struct {
	Pageref         string    `json:"pageref"`
	Starteddatetime time.Time `json:"startedDateTime"`
	Response        Response  `json:"response,omitempty"`
	Timings         Timing    `json:"timings"`
	Time            float32   `json:"time"`
	Securitystate   string    `json:"_securityState"`
	Serveripaddress string    `json:"serverIPAddress,omitempty"`
	Connection      string    `json:"connection,omitempty"`
	Cache           Cache     `json:"cache,omitempty"`
	Request         Request   `json:"request,omitempty"`
}

type Har

type Har struct {
	Log Log `json:"log"`
}

Har represents an entire HTTP Archive See the following for more details: - https://en.wikipedia.org/wiki/HAR_(file_format) - http://www.softwareishard.com/blog/har-12-spec/ - https://w3c.github.io/web-performance/specs/HAR/Overview.html

func NewHar

func NewHar(r io.Reader) (*Har, error)

func (*Har) Draw

func (h *Har) Draw(w io.Writer) error

type Log

type Log struct {
	Version string   `json:"version"`
	Creator Property `json:"creator"`
	Browser Property `json:"browser"`
	Pages   Pages    `json:"pages"`
	Entries Entries  `json:"entries"`
}

type Page

type Page struct {
	Starteddatetime time.Time `json:"startedDateTime"`
	ID              string    `json:"id"`
	Title           string    `json:"title"`
	Pagetimings     struct {
		Oncontentload float32 `json:"onContentLoad"`
		Onload        float32 `json:"onLoad"`
	} `json:"pageTimings"`
}

type Pages

type Pages []Page

type Properties

type Properties []Property

type Property

type Property struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Request

type Request struct {
	Bodysize    int        `json:"bodySize"`
	Method      string     `json:"method"`
	URL         string     `json:"url"`
	Httpversion string     `json:"httpVersion"`
	Headers     Properties `json:"headers"`
	Cookies     Properties `json:"cookies"`
	Querystring Properties `json:"queryString"`
	Headerssize int        `json:"headersSize"`
	Postdata    Content    `json:"postData"`
}

type Response

type Response struct {
	Status      int        `json:"status"`
	Statustext  string     `json:"statusText"`
	Httpversion string     `json:"httpVersion"`
	Headers     Properties `json:"headers"`
	Cookies     Properties `json:"cookies"`
	Content     Content    `json:"content"`
	Redirecturl string     `json:"redirectURL"`
	Headerssize int        `json:"headersSize"`
	Bodysize    int        `json:"bodySize"`
}

type Timing

type Timing struct {
	Blocked float32 `json:"blocked"`
	DNS     float32 `json:"dns"`
	Connect float32 `json:"connect"`
	Ssl     float32 `json:"ssl"`
	Send    float32 `json:"send"`
	Wait    float32 `json:"wait"`
	Receive float32 `json:"receive"`
}

Directories

Path Synopsis
cmd
Package test contains test definitions, code, and data.
Package test contains test definitions, code, and data.

Jump to

Keyboard shortcuts

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