sourcer

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 13 Imported by: 0

README

Sourcer

Sourcer is a Go-based annotation-driven code generator designed to simplify repetitive coding tasks by using annotations directly in your source code. It can automate common patterns in development by generating code based on pre-defined annotations.

Features

  • Annotation-based code generation.
  • Supports Go language projects.
  • Lightweight and easy to integrate.

Usage

Add your annotations in the Go code and run Sourcer to generate the necessary boilerplate.

Notes

I will try to add more information and examples of use in my free time

License

MIT Licence

Documentation

Overview

Pakiet do analizy kodów źródłowych w go

Index

Constants

View Source
const GO_FILES = "^(.*).go$"

const GO_FILES = "^[^\\$]+\\.go$"

View Source
const SKIP_FILES = "(^(zz)?[^\\$][^_]+\\$)|(_test)\\.go$"

const SKIP_FILES = "^(zz)?[^\\$][^_]+\\$\\.go$"

Variables

This section is empty.

Functions

func AddUnique

func AddUnique(arr []string, values ...string) []string

func ErrorInAnno

func ErrorInAnno(fileName string, ann annotations.Annotation, format string, args ...interface{}) error

func ErrorInOperation

func ErrorInOperation(op *model.Operation, annotName string, format string, args ...interface{}) error

func GetOnlyFileNames

func GetOnlyFileNames(filepaths []string) []string

func IfErrorPrint

func IfErrorPrint(err error, format string, args ...interface{})

func InStrSlice

func InStrSlice(value string, slice []string) bool

func InStrSliceRequire

func InStrSliceRequire(slice []string, beforeCompare func(s string) string, allowNotListed bool, min int, max int, values ...string) (err error, foundedItems []string)

Czy w tablicy $slice wystepują zmienne $values? przed porównaniem jeśli $beforeCompare jest != nil wykonaj na elemencie $beforeCompare($slice[x]) $allowNotListed czy jest ok jeśli znajdziemy elementy nie pasujące do $values $min min wymagana liczba odnaleziony elementów $max min wymagana liczba elementów

func IsDirectory

func IsDirectory(name string) bool

isDirectory reports whether the named file is a directory.

func ParseByRegExp

func ParseByRegExp(packageName, dirName string, filenameRegex string) (*generator.Config, error)

Prasuj pliki, których nazwa pasują do wyrażenia w folder dirName

func ParseGoFilesInDir

func ParseGoFilesInDir(packageName, dirname string) (*generator.Config, error)

Prasuj wszyskie pliki *.go w folder dirName

func ParseSelectedGoFiles

func ParseSelectedGoFiles(packageName, dirName string, files []string) (*generator.Config, error)

Prasuj wszyskie pliki *.go z listy files w folder dirName

func ParseSourceDir

func ParseSourceDir(packageName, dirName string, filenameRegex string, matcher func(name string) bool) (*generator.Config, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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