pkg

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProjectDirectory = filepath.Dir(filepath.Dir(filePath))
)

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func ConvertHTMLToPDF

func ConvertHTMLToPDF(outputFile string, data []byte) error

func DecodeFromBase64

func DecodeFromBase64(v interface{}, enc string) error

func EncodeToBase64

func EncodeToBase64(v interface{}) (string, error)

func FormatDocuments

func FormatDocuments(docs any, cols ...string) string

func HashPassword

func HashPassword(password string) (string, error)

func MustHashPassword

func MustHashPassword(password string) string

func ParseDate

func ParseDate(date string) (time.Time, error)

func ParseGraphQLData

func ParseGraphQLData(src *graphql.Result, dst any, key string) error

func ParseInto

func ParseInto(src any, dst any) error

func ParseProtoAnyInto

func ParseProtoAnyInto(src *anypb.Any, dst any) error

func ParseTime

func ParseTime(tim string) (time.Time, error)

func ProtoAnyToMap

func ProtoAnyToMap(in *anypb.Any) (map[string]interface{}, error)

func SplitString

func SplitString(input string, sep rune) []string

func StartOfMonth

func StartOfMonth() time.Time

func ToProtoAny

func ToProtoAny(in any) (*anypb.Any, error)

Types

type Options

type Options struct {
	Style        table.Style
	EnableStdout bool
	RenderType   RenderType
}

type Printer

type Printer interface {
	PrintDocument(doc interface{}) string
	PrintDocuments(docs interface{}) string

	WithColumns(columns ...string) Printer
	WithExceptColumns(exceptColumns []string) Printer
	WithAllColumns() Printer
	WithStyle(style table.Style) Printer
	WithStdout(stdout bool) Printer
	WithRenderType(typ RenderType) Printer

	ClearColumns()
}

func NewPrinter

func NewPrinter(options Options) Printer

type RenderType

type RenderType string
const (
	RenderTypeDefault  RenderType = "default"
	RenderTypeCSV      RenderType = "csv"
	RenderTypeHTML     RenderType = "html"
	RenderTypeMarkdown RenderType = "markdown"
)

Jump to

Keyboard shortcuts

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