sitesyncstate

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ranges = [...]string{
		Invalid:                               "Invalid",
		InitialStage:                          "InitialStage",
		Starting:                              "Starting",
		Restarting:                            "Restarting",
		Reloading:                             "Reloading",
		Stopping:                              "Stopping",
		ConfigSyntaxIssue:                     "ConfigSyntaxIssue",
		NewConfigSyntaxIssue:                  "NewConfigSyntaxIssue",
		ExistingFileModifySyntaxIssue:         "ExistingFileModifySyntaxIssue",
		Synchronizing:                         "Synchronizing",
		SyncedRunning:                         "SyncedRunning",
		SyncedSyntaxIssue:                     "SyncedSyntaxIssue",
		SyncedDuplicateDomain:                 "SyncedDuplicateDomain",
		SyncedDuplicateDefaultServer:          "SyncedDuplicateDefaultServer",
		SyncedButStopped:                      "SyncedButStopped",
		SyncedButFailedToStart:                "SyncedButFailedToStart",
		SyncedReloadRequired:                  "SyncedReloadRequired",
		SyncedRestartRequired:                 "SyncedRestartRequired",
		UnSynchronised:                        "UnSynchronised",
		UnSyncNewFileDetected:                 "UnSyncNewFileDetected",
		UnSyncExistingFileChanged:             "UnSyncExistingFileChanged",
		UnSyncExistingSiteIdentifierCorrupted: "UnSyncExistingSiteIdentifierCorrupted",
		UnSyncNewFilePlusExistingFileChanged:  "UnSyncNewFilePlusExistingFileChanged",
		UnSynchronisedRunningProperly:         "UnSynchronisedRunningProperly",
		UnSynchronisedFailedToStart:           "UnSynchronisedFailedToStart",
		UnSynchronisedFailedToStop:            "UnSynchronisedFailedToStop",
		UnSynchronisedFailedToRestart:         "UnSynchronisedFailedToRestart",
		UnSynchronisedFailedToReload:          "UnSynchronisedFailedToReload",
		UnSyncConfigRemoved:                   "UnSyncConfigRemoved",
		UnSyncDomainRemoved:                   "UnSyncDomainRemoved",
		UnSyncModuleRemoved:                   "UnSyncModuleRemoved",
		UnSyncDefaultServerDuplicate:          "UnSyncDefaultServerDuplicate",
		UnSyncDuplicateDomain:                 "UnSyncDuplicateDomain",
		UnSyncUnAuthorizedDomain:              "UnSyncUnAuthorizedDomain",
		UnSyncIncludeFileMissing:              "UnSyncIncludeFileMissing",
		UnSyncSSLFileMissing:                  "UnSyncSSLFileMissing",
		UnSyncSSLKeyMissing:                   "UnSyncSSLKeyMissing",
		UnSyncSSLCertificateMissing:           "UnSyncSSLCertificateMissing",
		RejectedSiteFilesFound:                "RejectedSiteFilesFound",
		UnSyncCache:                           "UnSyncCache",
		InvalidateCache:                       "InvalidateCache",
		RebuildSynchronizeData:                "RebuildSynchronizeData",
		RebuildCache:                          "RebuildCache",
		RebuildingCache:                       "RebuildingCache",
		RestartRequired:                       "RestartRequired",
		ReloadRequired:                        "ReloadRequired",
		StopRequired:                          "StopRequired",
	}

	DescriptionMap = map[Variant]string{
		InitialStage:                          "first time running, nothing synchronized.",
		Starting:                              "Web server starting.",
		Restarting:                            "Web server restarting.",
		Reloading:                             "Web server reloading.",
		Stopping:                              "Web server stopping.",
		ConfigSyntaxIssue:                     "Any config syntax issue found.",
		NewConfigSyntaxIssue:                  "New config add to the system has syntax issue.",
		ExistingFileModifySyntaxIssue:         "Existing file modified has syntax issue.",
		Synchronizing:                         "Synchronizing data between web server, file system, user records, database records, cache.",
		SyncedRunning:                         "Everything is synchronized and working as expected.",
		SyncedSyntaxIssue:                     "Everything is synchronized but not working as expected and some how has syntax issue.",
		SyncedDuplicateDomain:                 "Everything is synchronized but duplicate domain found, which is unexpected.",
		SyncedDuplicateDefaultServer:          "Everything is synchronized but duplicate default server found, which is unexpected.",
		SyncedButStopped:                      "Everything is synchronized but web server stopped, which is unexpected.",
		SyncedButFailedToStart:                "Everything is synchronized but failed to start the web-server, which is unexpected.",
		SyncedReloadRequired:                  "Everything is synchronized, web server reload required.",
		SyncedRestartRequired:                 "Everything is synchronized, web server restart required.",
		UnSynchronised:                        "Generic un-synchronised (could be domain changed, file state changed, banned user, ...), which is unexpected.",
		UnSyncNewFileDetected:                 "UnSynchronised new file detected, which is unexpected. Should be changed from web-ui.",
		UnSyncExistingFileChanged:             "UnSynchronised existing file detected, which is unexpected. Should be changed from web-ui.",
		UnSyncExistingSiteIdentifierCorrupted: "UnSynchronised existing domain or site corrupted it's identifier, which is unexpected. Should NOT be modified by anyone.",
		UnSyncNewFilePlusExistingFileChanged:  "UnSynchronised new file and existing file, which is unexpected. Should be changed from web-ui.",
		UnSynchronisedRunningProperly:         "UnSynchronised which is unexpected, should be changed from web-ui. However, web server is running fine temporarily.",
		UnSynchronisedFailedToStart:           "UnSynchronised which is unexpected, should be changed from web-ui. Moreover, web server is failed to start.",
		UnSynchronisedFailedToStop:            "UnSynchronised which is unexpected, should be changed from web-ui. Moreover, web server is failed to stopped.",
		UnSynchronisedFailedToRestart:         "UnSynchronised which is unexpected, should be changed from web-ui. Moreover, web server is failed to restart.",
		UnSynchronisedFailedToReload:          "UnSynchronised which is unexpected, should be changed from web-ui. Moreover, web server is failed to reload.",
		UnSyncConfigRemoved:                   "UnSynchronised config file removed, which is unexpected. Should be changed from web-ui.",
		UnSyncDomainRemoved:                   "UnSynchronised domain file removed, which is unexpected. Should be changed from web-ui.",
		UnSyncModuleRemoved:                   "UnSynchronised module file removed, which is unexpected. Should be changed from web-ui.",
		UnSyncDefaultServerDuplicate:          "UnSynchronised duplicate default server found, which is unexpected. Should be changed from web-ui.",
		UnSyncDuplicateDomain:                 "UnSynchronised duplicate domain server found, which is unexpected. Should be changed from web-ui.",
		UnSyncUnAuthorizedDomain:              "UnSynchronised unauthorized domain assign to some user, which is unexpected. Should be changed from web-ui.",
		UnSyncIncludeFileMissing:              "UnSynchronised include file missing or not found or permission issue, which is unexpected. Should be changed from web-ui.",
		UnSyncSSLFileMissing: "UnSynchronised ssl file (key or certificate or both) missing or " +
			"not found or permission issue, which is unexpected. Should be changed from web-ui.",
		UnSyncSSLKeyMissing: "UnSynchronised ssl key missing or " +
			"not found or permission issue, which is unexpected. Should be changed from web-ui.",
		UnSyncSSLCertificateMissing: "UnSynchronised ssl certificate missing or " +
			"not found or permission issue, which is unexpected. Should be changed from web-ui.",
		RejectedSiteFilesFound: "Rejected site files found, which is unexpected.",
		UnSyncCache:            "Cache is in un-synced state, which is unexpected..",
		InvalidateCache:        "Cache asked to be invalidated",
		RebuildSynchronizeData: "Asked to rebuild synchronization data",
		RebuildCache:           "Rebuild cache state",
		RebuildingCache:        "Rebuilding cache state",
		RestartRequired:        "Restart required",
		ReloadRequired:         "Reload required",
		StopRequired:           "Stop required",
	}

	ErrorStateMap = map[Variant]bool{
		ConfigSyntaxIssue:                     true,
		NewConfigSyntaxIssue:                  true,
		ExistingFileModifySyntaxIssue:         true,
		SyncedSyntaxIssue:                     true,
		SyncedDuplicateDomain:                 true,
		SyncedDuplicateDefaultServer:          true,
		SyncedButFailedToStart:                true,
		UnSynchronised:                        true,
		UnSyncNewFileDetected:                 true,
		UnSyncExistingFileChanged:             true,
		UnSyncExistingSiteIdentifierCorrupted: true,
		UnSyncNewFilePlusExistingFileChanged:  true,
		UnSynchronisedRunningProperly:         true,
		UnSynchronisedFailedToStart:           true,
		UnSynchronisedFailedToStop:            true,
		UnSynchronisedFailedToRestart:         true,
		UnSynchronisedFailedToReload:          true,
		UnSyncConfigRemoved:                   true,
		UnSyncDomainRemoved:                   true,
		UnSyncModuleRemoved:                   true,
		UnSyncDefaultServerDuplicate:          true,
		UnSyncDuplicateDomain:                 true,
		UnSyncUnAuthorizedDomain:              true,
		UnSyncIncludeFileMissing:              true,
		UnSyncSSLFileMissing:                  true,
		UnSyncSSLKeyMissing:                   true,
		UnSyncSSLCertificateMissing:           true,
		RejectedSiteFilesFound:                true,
		RebuildSynchronizeData:                true,
	}

	UnSyncStateMap = map[Variant]bool{
		UnSynchronised:                        true,
		UnSyncNewFileDetected:                 true,
		UnSyncExistingFileChanged:             true,
		UnSyncExistingSiteIdentifierCorrupted: true,
		UnSyncNewFilePlusExistingFileChanged:  true,
		UnSynchronisedRunningProperly:         true,
		UnSynchronisedFailedToStart:           true,
		UnSynchronisedFailedToStop:            true,
		UnSynchronisedFailedToRestart:         true,
		UnSynchronisedFailedToReload:          true,
		UnSyncConfigRemoved:                   true,
		UnSyncDomainRemoved:                   true,
		UnSyncModuleRemoved:                   true,
		UnSyncDefaultServerDuplicate:          true,
		UnSyncDuplicateDomain:                 true,
		UnSyncUnAuthorizedDomain:              true,
		UnSyncIncludeFileMissing:              true,
		UnSyncSSLFileMissing:                  true,
		UnSyncSSLKeyMissing:                   true,
		UnSyncSSLCertificateMissing:           true,
	}

	SyncStateMap = map[Variant]bool{
		Synchronizing:                true,
		SyncedRunning:                true,
		SyncedSyntaxIssue:            true,
		SyncedDuplicateDomain:        true,
		SyncedDuplicateDefaultServer: true,
		SyncedButStopped:             true,
		SyncedButFailedToStart:       true,
		SyncedReloadRequired:         true,
		SyncedRestartRequired:        true,
	}

	BasicEnumImpl = enumimpl.New.BasicByte.Default(
		Invalid,
		Ranges[:])
)

Functions

func RangesInvalidErr

func RangesInvalidErr() error

Types

type Variant

type Variant byte
const (
	Invalid      Variant = iota
	InitialStage         // nothing is saved before
	Starting
	Restarting
	Reloading
	Stopping
	ConfigSyntaxIssue
	NewConfigSyntaxIssue
	ExistingFileModifySyntaxIssue
	Synchronizing // the state where admin start to synchronize
	SyncedRunning // saved and cached
	SyncedSyntaxIssue
	SyncedDuplicateDomain
	SyncedDuplicateDefaultServer
	SyncedButStopped
	SyncedButFailedToStart
	SyncedReloadRequired
	SyncedRestartRequired
	UnSynchronised
	UnSyncNewFileDetected
	UnSyncExistingFileChanged
	UnSyncExistingSiteIdentifierCorrupted
	UnSyncNewFilePlusExistingFileChanged
	UnSynchronisedRunningProperly
	UnSynchronisedFailedToStart
	UnSynchronisedFailedToStop
	UnSynchronisedFailedToRestart
	UnSynchronisedFailedToReload
	UnSyncConfigRemoved
	UnSyncDomainRemoved
	UnSyncModuleRemoved
	UnSyncDefaultServerDuplicate
	UnSyncDuplicateDomain
	UnSyncUnAuthorizedDomain
	UnSyncIncludeFileMissing
	UnSyncSSLFileMissing
	UnSyncSSLKeyMissing
	UnSyncSSLCertificateMissing
	RejectedSiteFilesFound
	UnSyncCache
	InvalidateCache
	RebuildSynchronizeData
	RebuildCache
	RebuildingCache
	RestartRequired
	ReloadRequired
	StopRequired
)

func Max

func Max() Variant

func Min

func Min() Variant

func New

func New(name string) (Variant, error)

func NewMust

func NewMust(name string) Variant

func (Variant) AllNameValues

func (it Variant) AllNameValues() []string

func (Variant) AsBasicByteEnumContractsBinder

func (it Variant) AsBasicByteEnumContractsBinder() enuminf.BasicByteEnumContractsBinder

func (Variant) AsBasicEnumContractsBinder

func (it Variant) AsBasicEnumContractsBinder() enuminf.BasicEnumContractsBinder

func (Variant) AsJsonContractsBinder

func (it Variant) AsJsonContractsBinder() corejson.JsonContractsBinder

func (Variant) AsJsonMarshaller

func (it Variant) AsJsonMarshaller() corejson.JsonMarshaller

func (Variant) AsJsoner

func (it Variant) AsJsoner() corejson.Jsoner

func (Variant) Description

func (it Variant) Description() string

func (Variant) EnumType

func (it Variant) EnumType() enuminf.EnumTyper

func (Variant) Error

func (it Variant) Error() error

func (Variant) Format

func (it Variant) Format(format string) (compiled string)

func (Variant) IntegerEnumRanges

func (it Variant) IntegerEnumRanges() []int

func (Variant) Is

func (it Variant) Is(possibleState Variant) bool

func (Variant) IsAboveOrEqual

func (it Variant) IsAboveOrEqual(level Variant) bool

func (Variant) IsAnyKindOfError

func (it Variant) IsAnyKindOfError() bool

func (Variant) IsAnyNamesOf

func (it Variant) IsAnyNamesOf(names ...string) bool

func (Variant) IsAnyOf

func (it Variant) IsAnyOf(anyOfItems ...Variant) bool

func (Variant) IsAnyValuesEqual

func (it Variant) IsAnyValuesEqual(anyByteValues ...byte) bool

func (Variant) IsByteValueEqual

func (it Variant) IsByteValueEqual(value byte) bool

func (Variant) IsEqual

func (it Variant) IsEqual(level Variant) bool

func (Variant) IsInitialStage

func (it Variant) IsInitialStage() bool

func (Variant) IsInvalid

func (it Variant) IsInvalid() bool

func (Variant) IsLowerOrEqual

func (it Variant) IsLowerOrEqual(level Variant) bool

func (Variant) IsNameEqual

func (it Variant) IsNameEqual(name string) bool

func (Variant) IsNotError

func (it Variant) IsNotError() bool

func (Variant) IsSyncLogically

func (it Variant) IsSyncLogically() bool

func (Variant) IsSyncedRunning

func (it Variant) IsSyncedRunning() bool

func (Variant) IsSynchronizing

func (it Variant) IsSynchronizing() bool

func (Variant) IsUnSyncLogically

func (it Variant) IsUnSyncLogically() bool

func (Variant) IsUnSynchronised

func (it Variant) IsUnSynchronised() bool

func (Variant) IsUnknown

func (it Variant) IsUnknown() bool

func (Variant) IsValid

func (it Variant) IsValid() bool

func (Variant) IsValueEqual

func (it Variant) IsValueEqual(value byte) bool

func (Variant) Json

func (it Variant) Json() corejson.Result

func (*Variant) JsonParseSelfInject

func (it *Variant) JsonParseSelfInject(jsonResult *corejson.Result) error

func (Variant) JsonPtr

func (it Variant) JsonPtr() *corejson.Result

func (Variant) MarshalJSON

func (it Variant) MarshalJSON() ([]byte, error)

func (Variant) MaxByte

func (it Variant) MaxByte() byte

func (Variant) MaxInt

func (it Variant) MaxInt() int

func (Variant) MaxValueString

func (it Variant) MaxValueString() string

func (Variant) MinByte

func (it Variant) MinByte() byte

func (Variant) MinInt

func (it Variant) MinInt() int

func (Variant) MinMaxAny

func (it Variant) MinMaxAny() (min, max interface{})

func (Variant) MinValueString

func (it Variant) MinValueString() string

func (Variant) Name

func (it Variant) Name() string

func (Variant) NameValue

func (it Variant) NameValue() string

func (Variant) OnlySupportedErr

func (it Variant) OnlySupportedErr(names ...string) error

func (Variant) OnlySupportedMsgErr

func (it Variant) OnlySupportedMsgErr(message string, names ...string) error

func (Variant) RangeNamesCsv

func (it Variant) RangeNamesCsv() string

func (Variant) RangesByte

func (it Variant) RangesByte() []byte

func (Variant) RangesDynamicMap

func (it Variant) RangesDynamicMap() map[string]interface{}

func (Variant) String

func (it Variant) String() string

func (Variant) ToNumberString

func (it Variant) ToNumberString() string

func (Variant) ToPtr

func (it Variant) ToPtr() *Variant

func (Variant) TypeName

func (it Variant) TypeName() string

func (*Variant) UnmarshalJSON

func (it *Variant) UnmarshalJSON(data []byte) error

func (Variant) UnmarshallEnumToValue

func (it Variant) UnmarshallEnumToValue(
	jsonUnmarshallingValue []byte,
) (byte, error)

func (Variant) Value

func (it Variant) Value() byte

func (Variant) ValueByte

func (it Variant) ValueByte() byte

func (Variant) ValueInt

func (it Variant) ValueInt() int

func (Variant) ValueInt16

func (it Variant) ValueInt16() int16

func (Variant) ValueInt32

func (it Variant) ValueInt32() int32

func (Variant) ValueInt8

func (it Variant) ValueInt8() int8

func (Variant) ValueString

func (it Variant) ValueString() string

func (Variant) ValueUInt16

func (it Variant) ValueUInt16() uint16

Jump to

Keyboard shortcuts

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