helpers

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const UrlPrefix = "type.googleapis.com/"

Variables

This section is empty.

Functions

func GetIdentifier

func GetIdentifier(m proto.Message) string

func GetName

func GetName(m proto.Message) string

func IsValidator

func IsValidator(v interface{}) bool

func LoadListProtoFromFile

func LoadListProtoFromFile[T proto.Message](path string) ([]T, error)

func LoadProtoFromFile

func LoadProtoFromFile(path string, v proto.Message) error

func MarshalListProtoMessage

func MarshalListProtoMessage[T proto.Message](opts protojson.MarshalOptions, messages []T) ([]byte, error)

func MessageSignature

func MessageSignature(m proto.Message) (string, error)

func RecursiveValidate

func RecursiveValidate(v interface{}) error

func SetIdentifier

func SetIdentifier(m proto.Message, identifier string)

func StoreListProtoToFile

func StoreListProtoToFile[T proto.Message](path string, messages []T) error

func StoreProtoToFile

func StoreProtoToFile(path string, v proto.Message) error

func TypeUrl

func TypeUrl[T proto.Message]() string

func TypeUrlFromMessage

func TypeUrlFromMessage(m proto.Message) string

func Validate

func Validate(message proto.Message) error

Types

type Identifiable

type Identifiable interface {
	GetIdentifier() string
	SetIdentifier(string)
}

type Named

type Named interface {
	GetName() string
}

type Validator

type Validator interface {
	InitData() error
	Validate() error
}

Jump to

Keyboard shortcuts

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