godict

package module
v0.0.0-...-bd82582 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 8 Imported by: 1

README

godict

Go Report Card GoDoc

godict is a simple library that generates string patterns based on dictionary.

Requirement

Go 1.15

Installing

go get github.com/hlts2/godict

Example

package main

import (
	"context"
	"log"

	"github.com/hlts2/godict"
)

func main() {
	dict, err := godict.New()
	if err != nil {
		log.Fatal(err)
	}

	log.Println("start to search pattern: 3dmax")

	err = dict.Do(context.Background(), func(pattern string) {
		if pattern == "3dmax" {
			log.Printf("find: %s\n", pattern)
		}
	})
	if err != nil {
		log.Fatal(err)
	}
}

Contribution

  1. Fork it ( https://github.com/hlts2/godict/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

hlts2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dictionary

type Dictionary interface {
	Do(ctx context.Context, fn func(pattern string)) error
}

func New

func New(opts ...Option) (Dictionary, error)

type Option

type Option func(d *dictionary) error

func WithPath

func WithPath(paths ...string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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