id

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID struct {
	// V is a unique identifier.
	// example: 123e4567-e89b-12d3-a456-426655440000
	// required:true
	V *string `json:"id"`
}

ID is a custom type for database-agnostic unique IDs. swagger:model

func NewID

func NewID() *ID

NewDBID generates a new ID.

func NewIDFromString

func NewIDFromString(v string) *ID

NewIDFromString converts string to ID.

func (*ID) GetV

func (id *ID) GetV() string

func (*ID) IsEmpty

func (id *ID) IsEmpty() bool

IsEmpty checks if the ID is empty.

func (ID) MarshalBSON

func (id ID) MarshalBSON() ([]byte, error)

MarshalBSON implements the bson.Marshaler interface for Mongo compatibility.

func (*ID) SetV

func (id *ID) SetV(x string)

func (*ID) String

func (id *ID) String() string

String implements the Stringer interface.

func (*ID) UnmarshalBSON

func (id *ID) UnmarshalBSON(data []byte) error

UnmarshalBSON implements the bson.Unmarshaler interface for Mongo compatibility.

Jump to

Keyboard shortcuts

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