gid

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gid package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromGlobalID

func FromGlobalID(globalID string) string

FromGlobalID converts a global ID string to a DB ID string

func ToGlobalID

func ToGlobalID(mt types.ModelType, id string) string

ToGlobalID converts a model type and DB ID to a global ID string

Types

type GlobalID

type GlobalID struct {
	Code string
	ID   string
}

GlobalID is a model ID with type information

func NewGlobalID

func NewGlobalID(mt types.ModelType, modelID string) *GlobalID

NewGlobalID returns a new GlobalID

func NewGlobalIDWithCode added in v0.46.0

func NewGlobalIDWithCode(code string, modelID string) *GlobalID

NewGlobalIDWithCode returns a new GlobalID using a provided code string

func ParseGlobalID

func ParseGlobalID(globalID string) (*GlobalID, error)

ParseGlobalID parses a global ID string and returns a GlobalID type

func (*GlobalID) String

func (g *GlobalID) String() string

String returns the string representation of the global ID

Jump to

Keyboard shortcuts

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