examples/

directory
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: GPL-2.0

README

Interpol can be used as a library in your own programs. The following snippet highlights the core parts of the library::


    package main

    import (
        "fmt"
        "log"
        "github.com/avahidi/interpol"
    )

    func main() {
        ip := interpol.New()
        vs, err := ip.AddMultiple(
            "{{counter min=10 max=33 step=7}}",
            "{{set data='ABCD' mode='linear'}}",
            "{{counter min=0 max=9}}",
        )

        if err != nil {
            log.Fatal(err)
        }

        for ip.Next() {
            fmt.Printf("%s-%s-%s\n", vs[0], vs[1], vs[2])
        }
    }

This code will generate the following output::

    10-A-0
    17-A-0
    ...
    31-D-)


More examples
~~~~~~~~~~~~~

For more advanced examples, see the following folders:

- **hodor** - demonstrates use of custom interpolators (as the name clearly implies :) )
- **discordia** - demonstrates use of custom modifiers
- **nena** - demonstrates use of copy
- **hackernews** - download 3 random HN comments from firebase using a random user-agent
- **webpass** - web form brute force example, because we are too cool to use hydra

Directories

Path Synopsis
dedicated to Stanislav Petrov who did cloud computing before it was cool
dedicated to Stanislav Petrov who did cloud computing before it was cool

Jump to

Keyboard shortcuts

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