store

package
v2.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 85 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PatchString = "PATCH"
	PutString   = "PUT"
)
View Source
const (
	FunctionHas = "has"
)
View Source
const (
	ISO8601Format = "2006-01-02T15:04:05.999Z"
)

Variables

View Source
var MetadataPatternKey = regexp.MustCompile(
	"^$|^[a-z.]+/$|^[a-z.]+/[a-z0-9][a-z0-9-_.]*[a-z0-9]$|^[a-z.]+/[a-z0-9]$|^[a-z]$|^[a-z0-9][a-z0-9-_.]*[a-z0-9]$")

MetadataPatternKey representing the metadata pattern for key.

View Source
var MetadataPatternValue = regexp.MustCompile("^$|^[a-z0-9]$|^[a-z0-9][a-z0-9+._-]*[a-z0-9]$")

MetadataPatternValue representing the metadata pattern for value.

View Source
var TypeNull = &expr.Type{TypeKind: &expr.Type_Null{Null: structpb.NullValue_NULL_VALUE}}

Functions

func BuildResourceMeta

func BuildResourceMeta(phy, logi map[string]string) *inv_v1.GetResourceResponse_ResourceMetadata

BuildResourceMeta builds the ResourceMetadata from the given map of physical and logical metadata. errors are not returned to the caller as they are skipped as of today.

func ConnectEntDB

func ConnectEntDB(writerDatabaseURL, readerDatabaseURL string) *ent.Client

ConnectEntDB creates a ent client with the given database URLs. writerDatabaseURL is the primary Database URL, that has write capabilities. readerDatabaseURL is the Database URL with write only access (reader replicas). If the reader URL is missing, the ent client will use only the writer/primary URL.

func EmptyEnumStateMap

func EmptyEnumStateMap(fname string, _ int32) (ent.Value, error)

EmptyEnumStateMap enum state mapping.

func GetOrderByOptions

func GetOrderByOptions[T OrderOption](orderBy string, columnValidator func(string) bool) (opts []T, err error)

GetOrderByOptions takes an AIP-132 compliant orderBy string and returns the corresponding ent OrderOption. columnValidator is used to ensure only valid fields are selected. If no order is chosen (empty string), this returns a selector sorting by resource ID in ascending order.

func HostEnumStateMap

func HostEnumStateMap(fname string, eint int32) (ent.Value, error)

enum state mapping.

func HostnicEnumStateMap

func HostnicEnumStateMap(fname string, eint int32) (ent.Value, error)

enum state mapping.

func IPAddressEnumsMap

func IPAddressEnumsMap(fname string, eint int32) (ent.Value, error)

enums mapping.

func InstanceEnumStateMap

func InstanceEnumStateMap(fname string, eint int32) (ent.Value, error)

InstanceEnumStateMap maps proto enum fields to their Ent equivalents.

func MetadataToMetaMap

func MetadataToMetaMap(metadata []Metadata) (map[string]string, error)

MetadataToMetaMap transforms the given slide of Metadata into a map of string {Metadata.key : Metadata.value}. Returns an error in case of duplicated keys exist in the metadata.

func NetlinkEnumStateMap

func NetlinkEnumStateMap(fname string, eint int32) (ent.Value, error)

enum state mapping.

func OSUpdatePolicyEnumStateMap added in v2.26.2

func OSUpdatePolicyEnumStateMap(fname string, eint int32) (ent.Value, error)

OSUpdatePolicyEnumStateMap maps proto enum fields to their Ent equivalents.

func OSUpdateRunEnumStateMap added in v2.27.0

func OSUpdateRunEnumStateMap(fname string, eint int32) (ent.Value, error)

OSUpdateRunEnumStateMap maps proto enum fields to their Ent equivalents.

func OsEnumStateMap

func OsEnumStateMap(fname string, eint int32) (ent.Value, error)

OsEnumStateMap maps proto enum fields to their Ent equivalents.

func ParseMetadata

func ParseMetadata(metadata string) (map[string]string, error)

ParseMetadata parses the given metadata, we expect a JSON encoded metadata that follows the Metadata struct definition.

func ProviderEnumStateMap

func ProviderEnumStateMap(fname string, eint int32) (ent.Value, error)

enum state mapping.

func RepeatedScheduleEnumStatusMap

func RepeatedScheduleEnumStatusMap(fname string, eint int32) (ent.Value, error)

enum status mapping.

func SingleScheduleEnumStatusMap

func SingleScheduleEnumStatusMap(fname string, eint int32) (ent.Value, error)

enum status mapping.

func TelemetryGroupEnumStatusMap

func TelemetryGroupEnumStatusMap(fname string, eint int32) (ent.Value, error)

enum status mapping.

func TelemetryProfileEnumStatusMap

func TelemetryProfileEnumStatusMap(fname string, eint int32) (ent.Value, error)

func ValidateMetadata

func ValidateMetadata(metadata string) (string, error)

ValidateMetadata verifies that the given JSON encoded metadata contains the required fields, otherwise returns an error.

func ValidateOSMetadata added in v2.26.2

func ValidateOSMetadata(metadata string) (string, error)

ValidateOSMetadata verifies that the given JSON encoded metadata contains the required fields, otherwise returns an error.

func ValidateTreeHierarchyResponse

func ValidateTreeHierarchyResponse(in *inventoryv1.GetTreeHierarchyResponse) error

ValidateTreeHierarchyResponse returns an error if the tree hierarchy contains resource with unexpected parents. For example, a site containing a host as a parent.

func WorkloadEnumStatusMap

func WorkloadEnumStatusMap(fname string, eint int32) (ent.Value, error)

enum status mapping.

func WorkloadMemberEnumStatusMap

func WorkloadMemberEnumStatusMap(fname string, eint int32) (ent.Value, error)

Types

type DeletionKind

type DeletionKind string
const (
	SOFT DeletionKind = "soft"
	HARD DeletionKind = "hard"
)

type DoubleResultReturningTxFn

type DoubleResultReturningTxFn[R1, R2 any] func(
	ctx context.Context,
	transactional func(ctx context.Context, tx *ent.Tx) (*R1, *R2, error)) (*R1, *R2, error)

func ExecuteInRoTxAndReturnDouble

func ExecuteInRoTxAndReturnDouble[R1, R2 any](tm TransactionManager) DoubleResultReturningTxFn[R1, R2]

func ExecuteInTxAndReturnDouble

func ExecuteInTxAndReturnDouble[R1, R2 any](tm TransactionManager) DoubleResultReturningTxFn[R1, R2]

type InstanceCarrier

type InstanceCarrier interface {
	SetInstanceID(id int)
}

type InvStore

type InvStore struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(dbURLWriter, dbURLReader string) *InvStore

func (*InvStore) CloseEntClient

func (is *InvStore) CloseEntClient() error

Close the ent client.

func (*InvStore) CreateCustomConfig added in v2.27.0

func (is *InvStore) CreateCustomConfig(ctx context.Context, in *computev1.CustomConfigResource) (*inv_v1.Resource, error)

func (*InvStore) CreateEndpoint

func (is *InvStore) CreateEndpoint(ctx context.Context, in *network_v1.EndpointResource) (*inv_v1.Resource, error)

func (*InvStore) CreateHost

func (is *InvStore) CreateHost(ctx context.Context, in *computev1.HostResource) (*inv_v1.Resource, error)

func (*InvStore) CreateHostgpu

func (is *InvStore) CreateHostgpu(ctx context.Context, in *computev1.HostgpuResource) (*inv_v1.Resource, error)

func (*InvStore) CreateHostnic

func (is *InvStore) CreateHostnic(ctx context.Context, in *computev1.HostnicResource) (*inv_v1.Resource, error)

func (*InvStore) CreateHoststorage

func (is *InvStore) CreateHoststorage(ctx context.Context, in *computev1.HoststorageResource) (*inv_v1.Resource, error)

func (*InvStore) CreateHostusb

func (is *InvStore) CreateHostusb(ctx context.Context, in *computev1.HostusbResource) (*inv_v1.Resource, error)

func (*InvStore) CreateIPAddress

func (is *InvStore) CreateIPAddress(ctx context.Context, in *network_v1.IPAddressResource) (*inv_v1.Resource, error)

func (*InvStore) CreateInstance

func (is *InvStore) CreateInstance(ctx context.Context, in *computev1.InstanceResource) (*inv_v1.Resource, error)

func (*InvStore) CreateLocalAccount

func (is *InvStore) CreateLocalAccount(ctx context.Context, in *localaccount_v1.LocalAccountResource) (*inv_v1.Resource, error)
func (is *InvStore) CreateNetlink(ctx context.Context, in *network_v1.NetlinkResource) (*inv_v1.Resource, error)

func (*InvStore) CreateNetworkSegment

func (is *InvStore) CreateNetworkSegment(ctx context.Context, in *network_v1.NetworkSegment) (*inv_v1.Resource, error)

func (*InvStore) CreateOSUpdatePolicy added in v2.26.2

func (is *InvStore) CreateOSUpdatePolicy(ctx context.Context, in *compute_v1.OSUpdatePolicyResource) (*inv_v1.Resource, error)

func (*InvStore) CreateOSUpdateRun added in v2.27.0

func (is *InvStore) CreateOSUpdateRun(ctx context.Context, in *compute_v1.OSUpdateRunResource) (*inv_v1.Resource, error)

func (*InvStore) CreateOs

func (*InvStore) CreateOu

func (is *InvStore) CreateOu(ctx context.Context, in *ou_v1.OuResource) (*inv_v1.Resource, error)

func (*InvStore) CreateProvider

func (is *InvStore) CreateProvider(ctx context.Context, in *provider_v1.ProviderResource) (*inv_v1.Resource, error)

func (*InvStore) CreateRegion

func (is *InvStore) CreateRegion(ctx context.Context, in *location_v1.RegionResource) (*inv_v1.Resource, error)

func (*InvStore) CreateRemoteAccessConfig

func (is *InvStore) CreateRemoteAccessConfig(ctx context.Context,
	in *remoteaccessv1.RemoteAccessConfiguration,
) (*inv_v1.Resource, error)

func (*InvStore) CreateRepeatedSchedule

func (is *InvStore) CreateRepeatedSchedule(
	ctx context.Context,
	in *schedule_v1.RepeatedScheduleResource,
) (*inv_v1.Resource, error)

func (*InvStore) CreateSingleSchedule

func (is *InvStore) CreateSingleSchedule(ctx context.Context, in *schedule_v1.SingleScheduleResource) (*inv_v1.Resource, error)

func (*InvStore) CreateSite

func (is *InvStore) CreateSite(ctx context.Context, in *location_v1.SiteResource) (*inv_v1.Resource, error)

func (*InvStore) CreateTelemetryGroup

func (is *InvStore) CreateTelemetryGroup(
	ctx context.Context,
	in *telemetry_v1.TelemetryGroupResource,
) (*inv_v1.Resource, error)

func (*InvStore) CreateTelemetryProfile

func (is *InvStore) CreateTelemetryProfile(
	ctx context.Context,
	in *telemetry_v1.TelemetryProfile,
) (*inv_v1.Resource, error)

func (*InvStore) CreateTenant

func (is *InvStore) CreateTenant(ctx context.Context, in *tenantv1.Tenant) (*inv_v1.Resource, error)

func (*InvStore) CreateWorkload

func (is *InvStore) CreateWorkload(ctx context.Context, in *computev1.WorkloadResource) (*inv_v1.Resource, error)

func (*InvStore) CreateWorkloadMember

func (is *InvStore) CreateWorkloadMember(ctx context.Context, in *computev1.WorkloadMember) (*inv_v1.Resource, error)

func (*InvStore) DeleteCustomConfig added in v2.27.0

func (is *InvStore) DeleteCustomConfig(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteCustomConfigs added in v2.27.0

func (is *InvStore) DeleteCustomConfigs(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteEndpoint

func (is *InvStore) DeleteEndpoint(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteEndpoints

func (is *InvStore) DeleteEndpoints(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHost

func (is *InvStore) DeleteHost(ctx context.Context, id, tenantID string) (*inv_v1.Resource, bool, error)

func (*InvStore) DeleteHostGPUs

func (is *InvStore) DeleteHostGPUs(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHostNICs

func (is *InvStore) DeleteHostNICs(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHostStorages

func (is *InvStore) DeleteHostStorages(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHostUSBs

func (is *InvStore) DeleteHostUSBs(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHostgpu

func (is *InvStore) DeleteHostgpu(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteHostnic

func (is *InvStore) DeleteHostnic(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteHosts

func (is *InvStore) DeleteHosts(
	ctx context.Context, tenantID string, enforce bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteHoststorage

func (is *InvStore) DeleteHoststorage(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteHostusb

func (is *InvStore) DeleteHostusb(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteIPAddress

func (is *InvStore) DeleteIPAddress(_ context.Context, _ string) (*inv_v1.Resource, bool, error)

func (*InvStore) DeleteIPAddresses

func (is *InvStore) DeleteIPAddresses(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteInstance

func (is *InvStore) DeleteInstance(ctx context.Context, id string) (*inv_v1.Resource, bool, error)

func (*InvStore) DeleteInstances

func (is *InvStore) DeleteInstances(
	ctx context.Context, tenantID string, enforce bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteLocalAccount

func (is *InvStore) DeleteLocalAccount(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteLocalAccounts

func (is *InvStore) DeleteLocalAccounts(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)
func (is *InvStore) DeleteNetLinks(
	ctx context.Context, tenantID string, enforce bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)
func (is *InvStore) DeleteNetlink(ctx context.Context, id string) (*inv_v1.Resource, bool, error)

func (*InvStore) DeleteNetworkSegment

func (is *InvStore) DeleteNetworkSegment(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteNetworkSegments

func (is *InvStore) DeleteNetworkSegments(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteOSUpdatePolicies added in v2.26.2

func (is *InvStore) DeleteOSUpdatePolicies(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteOSUpdatePolicy added in v2.26.2

func (is *InvStore) DeleteOSUpdatePolicy(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteOSUpdateRun added in v2.27.0

func (is *InvStore) DeleteOSUpdateRun(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteOSUpdateRuns added in v2.27.0

func (is *InvStore) DeleteOSUpdateRuns(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteOSes

func (is *InvStore) DeleteOSes(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteOs

func (is *InvStore) DeleteOs(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteOu

func (is *InvStore) DeleteOu(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteOus

func (is *InvStore) DeleteOus(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteProvider

func (is *InvStore) DeleteProvider(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteProviders

func (is *InvStore) DeleteProviders(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteRegion

func (is *InvStore) DeleteRegion(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteRegions

func (is *InvStore) DeleteRegions(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteRepeatedSchedule

func (is *InvStore) DeleteRepeatedSchedule(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteRepeatedSchedules

func (is *InvStore) DeleteRepeatedSchedules(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteSingleSchedule

func (is *InvStore) DeleteSingleSchedule(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteSingleSchedules

func (is *InvStore) DeleteSingleSchedules(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteSite

func (is *InvStore) DeleteSite(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteSites

func (is *InvStore) DeleteSites(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteTelemetryGroup

func (is *InvStore) DeleteTelemetryGroup(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteTelemetryGroups

func (is *InvStore) DeleteTelemetryGroups(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteTelemetryProfile

func (is *InvStore) DeleteTelemetryProfile(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteTelemetryProfiles

func (is *InvStore) DeleteTelemetryProfiles(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteWorkload

func (is *InvStore) DeleteWorkload(ctx context.Context, id string) (*inv_v1.Resource, bool, error)

func (*InvStore) DeleteWorkloadMember

func (is *InvStore) DeleteWorkloadMember(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) DeleteWorkloadMembers

func (is *InvStore) DeleteWorkloadMembers(
	ctx context.Context, tenantID string, _ bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) DeleteWorkloads

func (is *InvStore) DeleteWorkloads(
	ctx context.Context, tenantID string, enforce bool,
) ([]*util.Tuple[DeletionKind, *inv_v1.Resource], error)

func (*InvStore) FilterCustomConfigs added in v2.27.0

func (is *InvStore) FilterCustomConfigs(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterEndpoints

func (is *InvStore) FilterEndpoints(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterHostgpus

func (is *InvStore) FilterHostgpus(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterHostnics

func (is *InvStore) FilterHostnics(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterHosts

func (is *InvStore) FilterHosts(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*cl.ResourceTenantIDCarrier, int, error)

func (*InvStore) FilterHoststorage

func (is *InvStore) FilterHoststorage(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterHostusb

func (is *InvStore) FilterHostusb(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterIPAddress

func (is *InvStore) FilterIPAddress(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterInstances

func (is *InvStore) FilterInstances(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterLocalAccounts

func (is *InvStore) FilterLocalAccounts(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)
func (is *InvStore) FilterNetlinks(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterNetworkSegments

func (is *InvStore) FilterNetworkSegments(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterOSUpdatePolicies added in v2.26.2

func (is *InvStore) FilterOSUpdatePolicies(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterOSUpdateRuns added in v2.27.0

func (is *InvStore) FilterOSUpdateRuns(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterOss

func (is *InvStore) FilterOss(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*cl.ResourceTenantIDCarrier, int, error)

func (*InvStore) FilterOus

func (is *InvStore) FilterOus(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*cl.ResourceTenantIDCarrier, int, error)

func (*InvStore) FilterProviders

func (is *InvStore) FilterProviders(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterRegions

func (is *InvStore) FilterRegions(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterRemoteAccessConfig

func (is *InvStore) FilterRemoteAccessConfig(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterRepeatedSchedules

func (is *InvStore) FilterRepeatedSchedules(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterSingleSchedules

func (is *InvStore) FilterSingleSchedules(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterSites

func (is *InvStore) FilterSites(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*cl.ResourceTenantIDCarrier, int, error)

func (*InvStore) FilterTelemetryGroup

func (is *InvStore) FilterTelemetryGroup(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterTelemetryProfile

func (is *InvStore) FilterTelemetryProfile(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterTenants

func (is *InvStore) FilterTenants(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterWorkload

func (is *InvStore) FilterWorkload(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FilterWorkloadMember

func (is *InvStore) FilterWorkloadMember(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*cl.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) FindResources

func (is *InvStore) FindResources(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*client.ResourceTenantIDCarrier, int, error,
)

func (*InvStore) GetCustomConfig added in v2.27.0

func (is *InvStore) GetCustomConfig(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetEndpoint

func (is *InvStore) GetEndpoint(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetHost

func (*InvStore) GetHostgpu

func (is *InvStore) GetHostgpu(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetHostnic

func (is *InvStore) GetHostnic(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetHoststorage

func (is *InvStore) GetHoststorage(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetHostusb

func (is *InvStore) GetHostusb(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetIPAddress

func (is *InvStore) GetIPAddress(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetInstance

func (is *InvStore) GetInstance(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetLocalAccount

func (is *InvStore) GetLocalAccount(ctx context.Context, id string) (*inv_v1.Resource, error)
func (is *InvStore) GetNetlink(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetNetworkSegment

func (is *InvStore) GetNetworkSegment(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetOSUpdatePolicy added in v2.26.2

func (is *InvStore) GetOSUpdatePolicy(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetOSUpdateRun added in v2.27.0

func (is *InvStore) GetOSUpdateRun(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetOs

func (is *InvStore) GetOs(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetOu

func (*InvStore) GetProvider

func (is *InvStore) GetProvider(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetRegion

func (*InvStore) GetRemoteAccessConfig

func (is *InvStore) GetRemoteAccessConfig(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetRepeatedSchedule

func (is *InvStore) GetRepeatedSchedule(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetSingleSchedule

func (is *InvStore) GetSingleSchedule(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetSite

func (*InvStore) GetSitesPerRegion

func (*InvStore) GetTelemetryGroup

func (is *InvStore) GetTelemetryGroup(
	ctx context.Context, id string,
) (*inv_v1.Resource, error)

func (*InvStore) GetTelemetryProfile

func (is *InvStore) GetTelemetryProfile(
	ctx context.Context, id string,
) (*inv_v1.Resource, error)

func (*InvStore) GetTenant

func (is *InvStore) GetTenant(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetTreeHierarchy

func (*InvStore) GetWorkload

func (is *InvStore) GetWorkload(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) GetWorkloadMember

func (is *InvStore) GetWorkloadMember(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) ListCustomConfigs added in v2.27.0

func (is *InvStore) ListCustomConfigs(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListEndpoints

func (is *InvStore) ListEndpoints(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListHostgpus

func (is *InvStore) ListHostgpus(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListHostnics

func (is *InvStore) ListHostnics(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListHosts

func (is *InvStore) ListHosts(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListHoststorage

func (is *InvStore) ListHoststorage(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListHostusb

func (is *InvStore) ListHostusb(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListIPAddress

func (is *InvStore) ListIPAddress(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListInheritedTelemetryProfile

func (is *InvStore) ListInheritedTelemetryProfile(
	ctx context.Context, in *inv_v1.ListInheritedTelemetryProfilesRequest,
) ([]*telemetry_v1.TelemetryProfile, int, error)

func (*InvStore) ListInstances

func (is *InvStore) ListInstances(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListLocalAccounts

func (is *InvStore) ListLocalAccounts(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)
func (is *InvStore) ListNetlinks(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListNetworkSegments

func (is *InvStore) ListNetworkSegments(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListOSUpdatePolicies added in v2.26.2

func (is *InvStore) ListOSUpdatePolicies(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListOSUpdateRuns added in v2.27.0

func (is *InvStore) ListOSUpdateRuns(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListOss

func (is *InvStore) ListOss(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListOus

func (is *InvStore) ListOus(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListProviders

func (is *InvStore) ListProviders(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListRegions

func (is *InvStore) ListRegions(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListRemoteAccessConfig

func (is *InvStore) ListRemoteAccessConfig(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListRepeatedSchedules

func (is *InvStore) ListRepeatedSchedules(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListResources

func (is *InvStore) ListResources(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListSingleSchedules

func (is *InvStore) ListSingleSchedules(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListSites

func (is *InvStore) ListSites(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListTelemetryGroup

func (is *InvStore) ListTelemetryGroup(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListTelemetryProfile

func (is *InvStore) ListTelemetryProfile(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListTenants

func (is *InvStore) ListTenants(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) ListWorkload

func (is *InvStore) ListWorkload(ctx context.Context, filter *inv_v1.ResourceFilter) (
	[]*inv_v1.GetResourceResponse, int, error,
)

func (*InvStore) ListWorkloadMember

func (is *InvStore) ListWorkloadMember(
	ctx context.Context, filter *inv_v1.ResourceFilter,
) ([]*inv_v1.GetResourceResponse, int, error)

func (*InvStore) SoftDeleteRemoteAccessConfig

func (is *InvStore) SoftDeleteRemoteAccessConfig(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) SoftDeleteTenant

func (is *InvStore) SoftDeleteTenant(ctx context.Context, id string) (*inv_v1.Resource, error)

func (*InvStore) TestGetEntClient

func (is *InvStore) TestGetEntClient() *ent.Client

func (*InvStore) UpdateDefaultTenantIDInTables

func (is *InvStore) UpdateDefaultTenantIDInTables(ctx context.Context, tables []string, tenantID string) error

UpdateDefaultTenantIDInTables updates the tenant_id in the specified tables where tenant_id equals '0'. It executes the update within a transaction to ensure atomicity, preventing partial updates in case of an error.

func (*InvStore) UpdateEndpoint

func (is *InvStore) UpdateEndpoint(
	ctx context.Context, id string, in *network_v1.EndpointResource, fm *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateHost

func (is *InvStore) UpdateHost(
	ctx context.Context, id string, in *computev1.HostResource, fieldmask *fieldmaskpb.FieldMask, tenantID string,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateHostgpu

func (is *InvStore) UpdateHostgpu(
	ctx context.Context, id string, in *computev1.HostgpuResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateHostnic

func (is *InvStore) UpdateHostnic(
	ctx context.Context, id string, in *computev1.HostnicResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateHoststorage

func (is *InvStore) UpdateHoststorage(
	ctx context.Context, id string, in *computev1.HoststorageResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateHostusb

func (is *InvStore) UpdateHostusb(
	ctx context.Context, id string, in *computev1.HostusbResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateIPAddress

func (is *InvStore) UpdateIPAddress(
	ctx context.Context,
	id string,
	in *network_v1.IPAddressResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateInstance

func (is *InvStore) UpdateInstance(
	ctx context.Context, id string, in *computev1.InstanceResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)
func (is *InvStore) UpdateNetlink(
	ctx context.Context, id string, in *network_v1.NetlinkResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateNetworkSegment

func (is *InvStore) UpdateNetworkSegment(
	ctx context.Context,
	id string,
	in *network_v1.NetworkSegment,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateOSUpdatePolicy added in v2.26.2

func (is *InvStore) UpdateOSUpdatePolicy(
	ctx context.Context,
	id string,
	in *compute_v1.OSUpdatePolicyResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateOSUpdateRun added in v2.27.0

func (is *InvStore) UpdateOSUpdateRun(
	ctx context.Context,
	id string,
	in *compute_v1.OSUpdateRunResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateOs

func (is *InvStore) UpdateOs(
	ctx context.Context,
	id string,
	in *os_v1.OperatingSystemResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateOu

func (is *InvStore) UpdateOu(
	ctx context.Context, id string, in *ou_v1.OuResource, fieldmask *fieldmaskpb.FieldMask, tenantID string,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateProvider

func (is *InvStore) UpdateProvider(
	ctx context.Context, id string, in *provider_v1.ProviderResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateRegion

func (is *InvStore) UpdateRegion(
	ctx context.Context, id string, in *location_v1.RegionResource, fm *fieldmaskpb.FieldMask, tenantID string,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateRemoteAccessConfig

func (is *InvStore) UpdateRemoteAccessConfig(
	ctx context.Context,
	id string,
	in *remoteaccessv1.RemoteAccessConfiguration,
	fm *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateRepeatedSchedule

func (is *InvStore) UpdateRepeatedSchedule(
	ctx context.Context,
	id string,
	in *schedule_v1.RepeatedScheduleResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateSingleSchedule

func (is *InvStore) UpdateSingleSchedule(
	ctx context.Context,
	id string,
	in *schedule_v1.SingleScheduleResource,
	fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateSite

func (is *InvStore) UpdateSite(
	ctx context.Context, id string, in *location_v1.SiteResource, fieldmask *fieldmaskpb.FieldMask, tenantID string,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateTelemetryGroup

func (is *InvStore) UpdateTelemetryGroup(
	ctx context.Context, id string, in *telemetry_v1.TelemetryGroupResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateTelemetryProfile

func (is *InvStore) UpdateTelemetryProfile(
	ctx context.Context, id string, in *telemetry_v1.TelemetryProfile, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

func (*InvStore) UpdateTenant

func (is *InvStore) UpdateTenant(
	ctx context.Context,
	id string,
	in *tenantv1.Tenant,
	fm *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateWorkload

func (is *InvStore) UpdateWorkload(
	ctx context.Context, id string, in *computev1.WorkloadResource, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, bool, error)

func (*InvStore) UpdateWorkloadMember

func (is *InvStore) UpdateWorkloadMember(
	ctx context.Context, id string, in *computev1.WorkloadMember, fieldmask *fieldmaskpb.FieldMask,
) (*inv_v1.Resource, error)

type Metadata

type Metadata struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Metadata struct representing the JSON metadata.

type NoResultReturningTxFn

type NoResultReturningTxFn func(
	ctx context.Context,
	transactional func(ctx context.Context, tx *ent.Tx) error) error

type SingleResultReturningTxFn

type SingleResultReturningTxFn[R1 any] func(
	ctx context.Context,
	transactional func(ctx context.Context, tx *ent.Tx) (*R1, error)) (*R1, error)

func ExecuteInRoTxAndReturnSingle

func ExecuteInRoTxAndReturnSingle[R1 any](tm TransactionManager) SingleResultReturningTxFn[R1]

func ExecuteInTxAndReturnSingle

func ExecuteInTxAndReturnSingle[R1 any](tm TransactionManager) SingleResultReturningTxFn[R1]

type TransactionManager

type TransactionManager interface {
	// contains filtered or unexported methods
}

type Transpiler

type Transpiler struct {
	// contains filtered or unexported fields
}

func (*Transpiler) Transpile

func (t *Transpiler) Transpile() (func(*sql.Selector), error)

Jump to

Keyboard shortcuts

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