safebsoncodecgen

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSONGenerator

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

func NewBsonGenerator

func NewBsonGenerator(c *Config, packages ...string) BSONGenerator

func (*BSONGenerator) Run

func (b *BSONGenerator) Run() error

type Config

type Config struct {
	PackageName string
	PackagePath string
	Direction   string
	FileName    string
}

func (*Config) GetDirection

func (c *Config) GetDirection() string

func (*Config) GetFileName

func (c *Config) GetFileName() string

func (*Config) GetPackageName

func (c *Config) GetPackageName() string

func (*Config) GetPackagePath

func (c *Config) GetPackagePath() string

type Data

type Data struct {
	PackageName string
	PackagePath string
	OptionTypes RegisterCodecTypes
}

type OptionCodec

type OptionCodec[T any] struct{}

func (OptionCodec[T]) DecodeValue

func (oc OptionCodec[T]) DecodeValue(
	ctx bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value,
) error

func (OptionCodec[T]) EncodeValue

func (oc OptionCodec[T]) EncodeValue(
	ctx bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value,
) error

type RegisterCodecType

type RegisterCodecType struct {
	PackagePath     string
	PackageName     string
	TypeName        string
	GetCodecSnippet func() string
}

type RegisterCodecTypes

type RegisterCodecTypes map[string]RegisterCodecType

func (RegisterCodecTypes) GetPackagePaths

func (r RegisterCodecTypes) GetPackagePaths(ownPath string) []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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