codec

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0, Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CognitoKeyJwtClaim = "CognitoJwtClaim"
	KeyJwtClaim        = "JwtClaim"
)
View Source
const Encode = "Encode"
View Source
const (
	JSON = "JSON"
)
View Source
const (
	KeyAsInts = "AsInts"
)
View Source
const (
	KeyAsStrings = "AsStrings"
)
View Source
const (
	KeyCSV = "CSV"
)
View Source
const KeyCriteriaBuilder = "CriteriaBuilder"
View Source
const (
	KeyCustomAuth = "CustomAuth"
)
View Source
const (
	KeyFilters = "AsFilters"
)
View Source
const (
	KeyFirebaseAuth = "FirebaseAuth"
)
View Source
const (
	KeyJsonTab = "JsonTab"
)
View Source
const (
	KeyNil = "Nil"
)
View Source
const (
	KeyTimeDiff = "TimeDiff"
)
View Source
const (
	KeyTransfer = "Transfer"
)
View Source
const (
	KeyURIChecksum = "URIChecksum"
)
View Source
const (
	KeyURIRewrite = "URIRewrite"
)
View Source
const (
	KeyXmlFilter = "XmlFilter"
)
View Source
const (
	KeyXmlTab = "XmlTab"
)
View Source
const Structql = "structql"
View Source
const VeltyCriteria = "VeltyCriteria"

Variables

This section is empty.

Functions

func NewCriteria

func NewCriteria(columns codec.ColumnsSource) *expand2.DataUnit

func NewCustomAuth added in v0.9.0

func NewCustomAuth(authenticator Authenticator) codec.Factory

NewCustomAuth create a new authenticator auth codec

func NewFirebaseAuth

func NewFirebaseAuth(firebaseAuth *firebase.Service) codec.Factory

func NotEnoughParametersError

func NotEnoughParametersError(got []string, name string, minLen int) error

func UnexpectedArgsLenError

func UnexpectedArgsLenError(got []string, expectedLen int, codecName string) error

func UnexpectedValueType

func UnexpectedValueType(wanted interface{}, got interface{}) error

func ValidateArgs

func ValidateArgs(codecConfig *codec.Config, expectedLen int, codecName string) error

func ValidateMinArgs

func ValidateMinArgs(config *codec.Config, name string, minLen int) error

Types

type AsInts

type AsInts struct {
}

func (*AsInts) ResultType

func (i *AsInts) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*AsInts) Value

func (i *AsInts) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type AsStrings

type AsStrings struct {
}

func (*AsStrings) ResultType

func (s *AsStrings) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*AsStrings) Value

func (s *AsStrings) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type Authenticator added in v0.9.1

type Authenticator interface {
	Authenticate(ctx context.Context, id, password string, expireIn time.Duration, claims string) (*auth.Token, error)
}

type CSV

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

func (*CSV) ResultType

func (c *CSV) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*CSV) Value

func (c *CSV) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type CriteriaBuilder

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

func (*CriteriaBuilder) ResultType

func (c *CriteriaBuilder) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*CriteriaBuilder) Value

func (c *CriteriaBuilder) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type CriteriaBuilderFactory

type CriteriaBuilderFactory struct {
}

func (*CriteriaBuilderFactory) New

func (c *CriteriaBuilderFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type CsvFactory

type CsvFactory string

func (CsvFactory) New

func (c CsvFactory) New(codec *codec.Config, _ ...codec.Option) (codec.Instance, error)

type EncodeFactory

type EncodeFactory struct {
}

func (*EncodeFactory) New

func (e *EncodeFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type Encoder

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

Encode,*Location,/,Country,Region,City

func (*Encoder) ResultType

func (e *Encoder) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*Encoder) Value

func (e *Encoder) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type Filters

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

func (*Filters) ResultType

func (e *Filters) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*Filters) Value

func (e *Filters) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type FiltersRegistry

type FiltersRegistry struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*FiltersRegistry) New

func (e *FiltersRegistry) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type FirebaseAuth

type FirebaseAuth struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*FirebaseAuth) New

func (e *FirebaseAuth) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

func (*FirebaseAuth) ResultType

func (e *FirebaseAuth) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*FirebaseAuth) Value

func (e *FirebaseAuth) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type JSONFactory

type JSONFactory struct{}

func (*JSONFactory) New

func (j *JSONFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type JSONParser

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

func (*JSONParser) ParseType

func (p *JSONParser) ParseType(typeName string) (reflect.Type, error)

func (*JSONParser) Value

func (p *JSONParser) Value(parent interface{}) (string, error)

type JSONParsers

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

func (*JSONParsers) ResultType

func (j *JSONParsers) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*JSONParsers) Value

func (j *JSONParsers) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type JsonTab

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

func (*JsonTab) ResultType

func (e *JsonTab) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*JsonTab) Value

func (e *JsonTab) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type JsonTabFactory

type JsonTabFactory struct{}

func (*JsonTabFactory) New

func (e *JsonTabFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type JwtCache

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

JwtClaim represents IDJWT visitor

func (*JwtCache) Lookup

func (j *JwtCache) Lookup(token string) *jwt.Claims

func (*JwtCache) Put

func (j *JwtCache) Put(token string, claims *jwt.Claims)

type JwtClaim

type JwtClaim struct{}

JwtClaim represents IDJWT visitor

func (*JwtClaim) ResultType

func (j *JwtClaim) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*JwtClaim) Value

func (j *JwtClaim) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type JwtEntry

type JwtEntry struct {
	Token string
	Email string
	*jwt.Claims
}

JwtClaim represents IDJWT visitor

type Nil

type Nil struct {
}

func (*Nil) ResultType

func (i *Nil) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*Nil) Value

func (i *Nil) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type Options

Options represents internal codec option

func NewOptions

func NewOptions(opts *codec.Options) *Options

NewOptions creates options

type ParentValue

type ParentValue struct {
	Value interface{}
	RType reflect.Type
}

type StructQLCodec

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

func NewStructQLCodec

func NewStructQLCodec(query string, paramType reflect.Type) (*StructQLCodec, error)

func (*StructQLCodec) ResultType

func (s *StructQLCodec) ResultType(_ reflect.Type) (reflect.Type, error)

func (*StructQLCodec) Value

func (s *StructQLCodec) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type StructQLFactory

type StructQLFactory string

func (StructQLFactory) New

func (s StructQLFactory) New(codec *codec.Config, _ ...codec.Option) (codec.Instance, error)

type TimeDiff

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

func (*TimeDiff) ResultType

func (u *TimeDiff) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*TimeDiff) Value

func (u *TimeDiff) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type TimeDiffFactory

type TimeDiffFactory struct{}

func (*TimeDiffFactory) New

func (e *TimeDiffFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type Transfer

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

func (*Transfer) ResultType

func (e *Transfer) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*Transfer) Value

func (e *Transfer) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type TransferFactory

type TransferFactory struct{}

func (*TransferFactory) New

func (e *TransferFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type URIRewriter

type URIRewriter struct {
	Exclusion []string
}

func (*URIRewriter) ResultType

func (u *URIRewriter) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*URIRewriter) Value

func (u *URIRewriter) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type URIRewriterFactory

type URIRewriterFactory struct{}

func (*URIRewriterFactory) New

func (e *URIRewriterFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type UriChecksum

type UriChecksum struct {
	URIRewriter
	Checksum string
}

func (*UriChecksum) ResultType

func (u *UriChecksum) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*UriChecksum) Value

func (u *UriChecksum) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type UriChecksumFactory

type UriChecksumFactory struct{}

func (*UriChecksumFactory) New

func (e *UriChecksumFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type VeltyCodec

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

func (*VeltyCodec) ResultType

func (v *VeltyCodec) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*VeltyCodec) Value

func (v *VeltyCodec) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type VeltyCriteriaFactory

type VeltyCriteriaFactory struct {
}

func (*VeltyCriteriaFactory) New

func (v *VeltyCriteriaFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type XmlFilter

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

func (*XmlFilter) ResultType

func (e *XmlFilter) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*XmlFilter) Value

func (e *XmlFilter) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type XmlFilterFactory

type XmlFilterFactory struct{}

func (*XmlFilterFactory) New

func (e *XmlFilterFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

type XmlTab

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

func (*XmlTab) ResultType

func (e *XmlTab) ResultType(paramType reflect.Type) (reflect.Type, error)

func (*XmlTab) Value

func (e *XmlTab) Value(ctx context.Context, raw interface{}, options ...codec.Option) (interface{}, error)

type XmlTabFactory

type XmlTabFactory struct{}

func (*XmlTabFactory) New

func (e *XmlTabFactory) New(codecConfig *codec.Config, options ...codec.Option) (codec.Instance, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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