state

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountState

type AccountState struct {
	AccountID string
	Users     []UserPermission
}

AccountState represents the full state of user permissions for a GTM account.

func FromConfig

func FromConfig(cfg config.Config) AccountState

FromConfig converts a Config into an AccountState (the "desired" state).

func (AccountState) UserMap

func (s AccountState) UserMap() map[string]UserPermission

UserMap returns a map of email -> UserPermission for quick lookups.

type ContainerPermission

type ContainerPermission struct {
	ContainerID string
	Permission  string
}

ContainerPermission represents a permission for a specific container.

type UserPermission

type UserPermission struct {
	Email           string
	AccountAccess   string
	ContainerAccess []ContainerPermission
}

UserPermission represents a normalized GTM user permission state.

func (UserPermission) ContainerMap

func (u UserPermission) ContainerMap() map[string]string

ContainerMap returns a map of containerID -> permission for a user.

Jump to

Keyboard shortcuts

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