winguid

package module
v0.0.0-...-58d6d2d Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 2 Imported by: 2

README

winguid Go Reference Go Report Card

The winguid package provides conversion functions for windows GUID types.

Documentation

Overview

Package winguid provides conversion functions for windows GUID types.

Index

Constants

This section is empty.

Variables

View Source
var BigEndian bigEndian

BigEndian is the big-endian implementation of ByteOrder.

View Source
var LittleEndian littleEndian

LittleEndian is the little-endian implementation of ByteOrder.

View Source
var NativeEndian nativeEndian

NativeEndian is the implementation of ByteOrder that always matches the endianness of the local system.

Functions

func New

func New(guid string) windows.GUID

New converts the given string into a windows.GUID struct that is compliant with the Windows API.

The supplied string may be in any of these formats:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

The supplied string is expected to be in hexadecimal notation with all fields in big-endian byte order. Note that some systems may supply mixed-endian or little-endian hexadecimal representations.

The conversion of the supplied string is not case-sensitive.

If the conversion fails an empty GUID will be returned.

func String

func String(guid windows.GUID) string

String returns a string representation of guid with this pattern:

{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

func TryNew

func TryNew(guid string) (g windows.GUID, ok bool)

TryNew performs the same operation as New, but it returns false if the conversion fails.

Types

type ByteOrder

type ByteOrder interface {
	GUID([]byte) windows.GUID
}

ByteOrder defines a byte order when converting to and from bytes.

Jump to

Keyboard shortcuts

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