domain

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MOTokenIndexes = []repos.IndexField{
	{
		Field: []repos.IndexKey{
			{Key: "id", Value: repos.IndexAsc},
		},
		Unique: true,
	},
	{
		Field: []repos.IndexKey{
			{Key: "accountName", Value: repos.IndexAsc},
			{Key: "clusterName", Value: repos.IndexAsc},
			{Key: "token", Value: repos.IndexAsc},
		},
		Unique: true,
	},
}
View Source
var Module = fx.Module(
	"domain",
	fx.Provide(func(
		ev *env.Env,
		moRepo repos.DbRepo[*MessageOfficeToken],
		edgeClustersRepo repos.DbRepo[*entities.PlatformEdgeCluster],
		allocatedClustersRepo repos.DbRepo[*entities.ClusterAllocation],

		logger *slog.Logger,
	) Domain {
		return &domain{
			moRepo: moRepo,
			env:    ev,
			logger: logger,
			PlatformEdgeDomain: PlatformEdgeDomain{Repo: &platform_edge.Repo{
				EdgeClusters:      edgeClustersRepo,
				AllocatedClusters: allocatedClustersRepo,
			}},
		}
	}),
)

Functions

This section is empty.

Types

type Domain

type Domain interface {
	GenClusterToken(ctx context.Context, accountName string, clusterName string) (string, error)
	FindClusterToken(ctx context.Context, clusterToken string) (*MessageOfficeToken, error)
	GetClusterToken(ctx context.Context, accountName string, clusterName string) (string, error)

	platform_edge.Domain
}

type MessageOfficeToken

type MessageOfficeToken struct {
	repos.BaseEntity `json:",inline"`
	AccountName      string `json:"accountName"`
	ClusterName      string `json:"clusterName"`
	Token            string `json:"token"`
	Granted          *bool  `json:"granted,omitempty"`
}

type PlatformEdgeDomain

type PlatformEdgeDomain struct {
	*platform_edge.Repo
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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