domain

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token        string
	RefreshToken string
	ExpiresAt    time.Time
	TokenType    string
}

AccessToken represents the authentication token

func (*AccessToken) GetAuthorizationHeader

func (at *AccessToken) GetAuthorizationHeader() string

GetAuthorizationHeader returns the formatted authorization header value

func (*AccessToken) IsExpired

func (at *AccessToken) IsExpired() bool

IsExpired checks if the access token has expired

type Application

type Application struct {
	ID          string
	Name        string
	Description string
	Metadata    map[string]any
	OrgID       string
	EnvTypes    []EnvType
	EnvCount    string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

func NewApplication

func NewApplication(name, description string, metadata map[string]any) *Application

type AuthResult

type AuthResult struct {
	Success     bool
	AccessToken *AccessToken
	Error       error
}

AuthResult represents the final result of an authentication process

type EnvType

type EnvType struct {
	ID          string
	OrgID       string
	AppID       string
	Name        string
	IsDefault   bool
	IsProtected bool
	Color       string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

func NewEnvType

func NewEnvType(appID, name string, isDefault, isProtected bool, color string) *EnvType

type EnvironmentSync

type EnvironmentSync struct {
	Local      map[string]string
	Remote     map[string]EnvironmentVariable
	ToAdd      []EnvironmentVariable
	ToUpdate   []EnvironmentVariable
	ToDelete   []string
	LastSynced time.Time
}

EnvironmentSync represents the sync state between local and remote environments

func NewEnvironmentSync

func NewEnvironmentSync(local map[string]string, remote map[string]EnvironmentVariable) *EnvironmentSync

NewEnvironmentSync creates a new EnvironmentSync instance

func (*EnvironmentSync) CalculateDiff

func (es *EnvironmentSync) CalculateDiff()

CalculateDiff determines which variables need to be added, updated, or deleted

func (*EnvironmentSync) GetSummary

func (es *EnvironmentSync) GetSummary() SyncSummary

GetSummary returns a summary of the changes to be made

func (*EnvironmentSync) HasChanges

func (es *EnvironmentSync) HasChanges() bool

HasChanges returns true if there are any differences between local and remote

func (*EnvironmentSync) ToMap

func (es *EnvironmentSync) ToMap() map[string]string

ToMap converts the environment variables to a simple key-value map

type EnvironmentVariable

type EnvironmentVariable struct {
	Key   string
	Value string
}

EnvironmentVariable represents a single environment variable

type LoginCredentials

type LoginCredentials struct {
	DeviceCode      string
	UserCode        string
	VerificationUri string
	ExpiresIn       int
	Interval        int
	ClientId        string
	AuthDomain      string
}

LoginCredentials represents the device code information needed for OAuth device flow

func (*LoginCredentials) GetExpirationTime

func (lc *LoginCredentials) GetExpirationTime() time.Time

GetExpirationTime returns when the device code expires

func (*LoginCredentials) GetInterval

func (lc *LoginCredentials) GetInterval() time.Duration

GetInterval returns the polling interval in seconds

func (*LoginCredentials) GetUserCode

func (lc *LoginCredentials) GetUserCode() string

GetUserCode returns the user code to be entered during authentication

func (*LoginCredentials) GetVerificationUri

func (lc *LoginCredentials) GetVerificationUri() string

GetVerificationUri returns the verification URI for user authentication

func (*LoginCredentials) IsExpired

func (lc *LoginCredentials) IsExpired() bool

IsExpired checks if the device code has expired

type SyncConfig

type SyncConfig struct {
	AppID     string `toml:"app_id"`
	EnvTypeID string `toml:"env_type_id"`
}

SyncConfig represents the configuration needed for syncing

type SyncSummary

type SyncSummary struct {
	AddCount    int
	UpdateCount int
	DeleteCount int
	LastSynced  time.Time
}

SyncSummary represents a summary of sync changes

type UserInfo

type UserInfo struct {
	UserId string
	Email  string
	Org    string
	Role   string
}

Jump to

Keyboard shortcuts

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