format

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFormats

func GetFormats() []string

func RegisterFormatDriver

func RegisterFormatDriver(name string, t FormatDriver)

Types

type Format

type Format struct {
	// contains filtered or unexported fields
}

func FindFormat

func FindFormat(ctx context.Context, name string) (*Format, error)

func (*Format) Format

func (t *Format) Format(data interface{}) ([]byte, []byte, error)

type FormatDriver

type FormatDriver interface {
	Prepare() error                                  // Prepare driver (eg: flag registration)
	Init(context.Context) error                      // Initialize driver (eg: parse keying)
	Format(data interface{}) ([]byte, []byte, error) // Send a message

}

type FormatInterface

type FormatInterface interface {
	Format(data interface{}) ([]byte, []byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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