identity

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Name string
	SID  sid.SID

	// Internal
	RawBytes     []byte
	RawBytesSize uint32
}

Identity represents a user identity, including its name and associated Security Identifier (SID).

Attributes:

  • Name (string): The name of the identity, typically representing a user or group.
  • SID (SID): The Security Identifier associated with the identity, used for access control.

Internal attributes:

  • RawBytes ([]byte): The raw byte data representing the identity, including the SID information.
  • RawBytesSize (uint32): The size of the raw byte data.

func (*Identity) Describe

func (identity *Identity) Describe(indent int)

Describe prints a detailed description of the Identity struct, including its SID and name, formatted with indentation for clarity.

Parameters:

  • indent (int): The indentation level for formatting the output. Each level increases the indentation depth, allowing for a hierarchical display of the Identity's components.

func (*Identity) Equal

func (identity *Identity) Equal(other *Identity) bool

Equal checks if two Identity objects are equal by comparing all their fields.

Parameters: - other: The other Identity to compare with

Returns: - bool: true if the Identities are equal, false otherwise

func (*Identity) Marshal

func (identity *Identity) Marshal() ([]byte, error)

Marshal serializes the Identity struct into a byte slice.

Returns:

  • []byte: The serialized byte slice representing the Identity.

func (*Identity) Unmarshal

func (identity *Identity) Unmarshal(marshalledData []byte) (int, error)

Unmarshal populates the Identity struct by parsing the provided raw byte slice. It extracts the SID from the raw bytes and attempts to assign a name if the SID is well-known.

Parameters:

  • RawBytes ([]byte): The raw byte data containing the SID information.

Jump to

Keyboard shortcuts

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