core

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEW     DiffType = "NEW"
	CHANGED DiffType = "CHANGED"
	DELETED DiffType = "DELETED"

	GROUP     DiffResult = "GROUP"
	CONFIG    DiffResult = "CONFIG"
	STRATEGY  DiffResult = "STRATEGY"
	COMPONENT DiffResult = "COMPONENT"
)
View Source
const (
	CoreHandlerStatusCreated = -1
	CoreHandlerStatusInit    = 0
	CoreHandlerStatusRunning = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

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

func NewApiService

func NewApiService(apiKey string, apiUrl string, caCertPath string) *ApiService

func (*ApiService) FetchSnapshot

func (a *ApiService) FetchSnapshot(domainId string, environment string) (string, error)

func (*ApiService) FetchSnapshotVersion

func (a *ApiService) FetchSnapshotVersion(domainId string, environment string) (string, error)

func (*ApiService) NewDataFromJson

func (c *ApiService) NewDataFromJson(jsonData []byte) model.Data

func (*ApiService) PushChanges

func (a *ApiService) PushChanges(domainId string, diff model.DiffResult) (PushChangeResponse, error)

type ComparatorService

type ComparatorService struct{}

func NewComparatorService

func NewComparatorService() *ComparatorService

func (*ComparatorService) CheckSnapshotDiff

func (c *ComparatorService) CheckSnapshotDiff(left model.Snapshot, right model.Snapshot, diffType DiffType) model.DiffResult

func (*ComparatorService) MergeResults

func (c *ComparatorService) MergeResults(diffResults []model.DiffResult) model.DiffResult

func (*ComparatorService) NewSnapshotFromJson

func (c *ComparatorService) NewSnapshotFromJson(jsonData []byte) model.Snapshot

func (*ComparatorService) RemoveDeleted

func (c *ComparatorService) RemoveDeleted(diffResult model.DiffResult) model.DiffResult

type CoreHandler

type CoreHandler struct {
	Status int
	// contains filtered or unexported fields
}

func NewCoreHandler

func NewCoreHandler(accountRepository repository.AccountRepository, apiService IAPIService,
	comparatorService IComparatorService) *CoreHandler

func (*CoreHandler) InitCoreHandlerGoroutine

func (c *CoreHandler) InitCoreHandlerGoroutine() (int, error)

func (*CoreHandler) StartAccountHandler

func (c *CoreHandler) StartAccountHandler(accountId string, gitService IGitService)

type DiffResult

type DiffResult string

type DiffType

type DiffType string

type GitService

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

func NewGitService

func NewGitService(repoURL string, encryptedToken string, branchName string) *GitService

func (*GitService) GetRepositoryData

func (g *GitService) GetRepositoryData(environment string) (*model.RepositoryData, error)

func (*GitService) PushChanges

func (g *GitService) PushChanges(environment string, content string) (string, error)

func (*GitService) UpdateRepositorySettings

func (g *GitService) UpdateRepositorySettings(repository string, encryptedToken string, branch string)

type GraphQLRequest

type GraphQLRequest struct {
	Query string `json:"query"`
}

type IAPIService

type IAPIService interface {
	FetchSnapshotVersion(domainId string, environment string) (string, error)
	FetchSnapshot(domainId string, environment string) (string, error)
	PushChanges(domainId string, diff model.DiffResult) (PushChangeResponse, error)
	NewDataFromJson(jsonData []byte) model.Data
}

type IComparatorService

type IComparatorService interface {
	CheckSnapshotDiff(left model.Snapshot, right model.Snapshot, diffType DiffType) model.DiffResult
	MergeResults(diffResults []model.DiffResult) model.DiffResult
	NewSnapshotFromJson(jsonData []byte) model.Snapshot
	RemoveDeleted(diffResult model.DiffResult) model.DiffResult
}

type IGitService

type IGitService interface {
	GetRepositoryData(environment string) (*model.RepositoryData, error)
	PushChanges(environment string, content string) (string, error)
	UpdateRepositorySettings(repository string, encryptedToken string, branch string)
}

type PushChangeResponse

type PushChangeResponse struct {
	Message string `json:"message"`
	Error   string `json:"error"`
	Version int    `json:"version"`
}

Jump to

Keyboard shortcuts

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