Documentation
¶
Index ¶
- Constants
- type ArtifactdRepository
- type BoundAddress
- type BuildArtifact
- func (a *BuildArtifact) CreatedTime() time.Time
- func (a *BuildArtifact) ID() string
- func (a *BuildArtifact) Namespace() string
- func (a *BuildArtifact) RefIDs() []string
- func (a *BuildArtifact) URL() string
- func (a *BuildArtifact) Validate() error
- func (a *BuildArtifact) WithCreatedTime(t time.Time) mycontent.Data
- func (a *BuildArtifact) WithEventID(id uint64) mycontent.VersionedData
- func (a *BuildArtifact) WithID(id string) mycontent.Data
- func (a *BuildArtifact) WithNamespace(id string) mycontent.Data
- func (a *BuildArtifact) WithURL(url string) mycontent.Data
- type CancelJobRequest
- type ClickHouseStorageConfig
- type CloudflareConfig
- type ClusterConfiguration
- type ConfigureHostJob
- type ConfirmDeployment
- type ContinueDeployment
- type DeploymentJob
- func (d *DeploymentJob) CreatedTime() time.Time
- func (d *DeploymentJob) ID() string
- func (d *DeploymentJob) Namespace() string
- func (d *DeploymentJob) RefIDs() []string
- func (d *DeploymentJob) URL() string
- func (d *DeploymentJob) Validate() error
- func (d *DeploymentJob) WithCreatedTime(t time.Time) mycontent.Data
- func (d *DeploymentJob) WithID(id string) mycontent.Data
- func (d *DeploymentJob) WithNamespace(id string) mycontent.Data
- func (d *DeploymentJob) WithURL(url string) mycontent.Data
- type DeploymentJobByService
- type DeploymentJobStatus
- type Env
- type Host
- func (a *Host) CreatedTime() time.Time
- func (a *Host) ID() string
- func (a *Host) Namespace() string
- func (a *Host) RefIDs() []string
- func (a *Host) URL() string
- func (a *Host) Validate() error
- func (a *Host) WithCreatedTime(t time.Time) mycontent.Data
- func (a *Host) WithID(id string) mycontent.Data
- func (a *Host) WithNamespace(id string) mycontent.Data
- func (a *Host) WithURL(url string) mycontent.Data
- type HostConfigurationState
- type HostConfigurationStatus
- type HostDeploymentJob
- type HostRestartServiceState
- type HostRestartServiceStatus
- type KV
- func (a *KV) CreatedTime() time.Time
- func (a *KV) ID() string
- func (a *KV) Namespace() string
- func (a *KV) RefIDs() []string
- func (a *KV) URL() string
- func (a *KV) Validate() error
- func (a *KV) WithCreatedTime(t time.Time) mycontent.Data
- func (a *KV) WithID(id string) mycontent.Data
- func (a *KV) WithNamespace(ns string) mycontent.Data
- func (a *KV) WithURL(url string) mycontent.Data
- type PendingUserAction
- type RaftConfig
- type RaftHost
- func (a *RaftHost) CreatedTime() time.Time
- func (a *RaftHost) ID() string
- func (a *RaftHost) Namespace() string
- func (a *RaftHost) RefIDs() []string
- func (a *RaftHost) URL() string
- func (a *RaftHost) Validate() error
- func (a *RaftHost) WithCreatedTime(t time.Time) mycontent.Data
- func (a *RaftHost) WithID(id string) mycontent.Data
- func (a *RaftHost) WithNamespace(id string) mycontent.Data
- func (a *RaftHost) WithURL(url string) mycontent.Data
- type RaftHostConfig
- type RaftReplica
- func (a *RaftReplica) CreatedTime() time.Time
- func (a *RaftReplica) ID() string
- func (a *RaftReplica) Namespace() string
- func (a *RaftReplica) RefIDs() []string
- func (a *RaftReplica) URL() string
- func (a *RaftReplica) Validate() error
- func (a *RaftReplica) WithCreatedTime(t time.Time) mycontent.Data
- func (a *RaftReplica) WithID(id string) mycontent.Data
- func (a *RaftReplica) WithNamespace(id string) mycontent.Data
- func (a *RaftReplica) WithURL(url string) mycontent.Data
- type RaftServiceConfig
- type RaftShardConfig
- type ReplicaConfig
- type Repository
- func (r *Repository) CreatedTime() time.Time
- func (r *Repository) ID() string
- func (r *Repository) Namespace() string
- func (r *Repository) RefIDs() []string
- func (r *Repository) URL() string
- func (r *Repository) Validate() error
- func (r *Repository) WithCreatedTime(t time.Time) mycontent.Data
- func (r *Repository) WithID(id string) mycontent.Data
- func (r *Repository) WithNamespace(id string) mycontent.Data
- func (r *Repository) WithURL(url string) mycontent.Data
- type RestartServiceJob
- type Routing
- func (c *Routing) CreatedTime() time.Time
- func (c *Routing) ID() string
- func (c *Routing) Namespace() string
- func (c *Routing) RefIDs() []string
- func (c *Routing) URL() string
- func (c *Routing) Validate() error
- func (c *Routing) WithCreatedTime(t time.Time) mycontent.Data
- func (c *Routing) WithID(id string) mycontent.Data
- func (c *Routing) WithNamespace(ns string) mycontent.Data
- func (c *Routing) WithURL(url string) mycontent.Data
- type Secret
- type ServiceDefinition
- func (a *ServiceDefinition) CreatedTime() time.Time
- func (a *ServiceDefinition) ID() string
- func (a *ServiceDefinition) Namespace() string
- func (a *ServiceDefinition) RefIDs() []string
- func (a *ServiceDefinition) URL() string
- func (a *ServiceDefinition) Validate() error
- func (a *ServiceDefinition) WithCreatedTime(t time.Time) mycontent.Data
- func (a *ServiceDefinition) WithID(id string) mycontent.Data
- func (a *ServiceDefinition) WithNamespace(id string) mycontent.Data
- func (a *ServiceDefinition) WithURL(url string) mycontent.Data
- type ServiceInstanceHost
- func (a *ServiceInstanceHost) CreatedTime() time.Time
- func (a *ServiceInstanceHost) ID() string
- func (a *ServiceInstanceHost) Namespace() string
- func (a *ServiceInstanceHost) RefIDs() []string
- func (a *ServiceInstanceHost) URL() string
- func (a *ServiceInstanceHost) Validate() error
- func (a *ServiceInstanceHost) WithCreatedTime(t time.Time) mycontent.Data
- func (a *ServiceInstanceHost) WithID(id string) mycontent.Data
- func (a *ServiceInstanceHost) WithNamespace(id string) mycontent.Data
- func (a *ServiceInstanceHost) WithURL(url string) mycontent.Data
- type StorageConfiguration
- type SubmitDeploymentJobRequest
Constants ¶
const ( // Overall status for the deployment job DeploymentJobStatusQueued DeploymentJobStatus = "QUEUED" DeploymentJobStatusConfiguring DeploymentJobStatus = "CONFIGURING" DeploymentJobStatusConfigured DeploymentJobStatus = "CONFIGURED" DeploymentJobStatusDeploying DeploymentJobStatus = "DEPLOYING" DeploymentJobStatusDeployed DeploymentJobStatus = "DEPLOYED" DeploymentJobStatusSuccess DeploymentJobStatus = "SUCCESS" DeploymentJobStatusCancelled DeploymentJobStatus = "CANCELLED" DeploymentJobStatusTimeOut DeploymentJobStatus = "TIMEOUT" DeploymentJobStatusFailed DeploymentJobStatus = "FAILED" // Host / worker specific configuring step status HostConfigurationStatusPending HostConfigurationStatus = "PENDING" HostConfigurationStatusConfiguring HostConfigurationStatus = "CONFIGURING" HostConfigurationStatusSuccess HostConfigurationStatus = "SUCCESS" HostConfigurationStatusFailed HostConfigurationStatus = "FAILED" HostConfigurationStatusCancelled HostConfigurationStatus = "CANCELLED" HostConfigurationStatusTimeOut HostConfigurationStatus = "TIMEOUT" // Host / worker specific deployment (restart service, routing, etc.) step status HostRestartServiceStatusPending HostRestartServiceStatus = "PENDING" HostRestartServiceStatusStarting HostRestartServiceStatus = "STARTING" // run cloudflared again HostRestartServiceStatusDrainTraffic HostRestartServiceStatus = "DRAIN_TRAFFIC" // stop cloudflared and wait; for networked service HostRestartServiceStatusRestarting HostRestartServiceStatus = "RESTARTING" // stop service, update symlink, start (systemd); for raft service HostRestartServiceStatusWaitReady HostRestartServiceStatus = "WAIT_READY" // healthcheck endpoint that includes raft get leader HostRestartServiceStatusRoutingTraffic HostRestartServiceStatus = "ROUTING_TRAFFIC" // run cloudflared again HostRestartServiceStatusSuccess HostRestartServiceStatus = "SUCCESS" HostRestartServiceStatusFailed HostRestartServiceStatus = "FAILED" HostRestartServiceStatusTimeOut HostRestartServiceStatus = "TIMEOUT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactdRepository ¶
type BoundAddress ¶
type BuildArtifact ¶
type BuildArtifact struct {
Ns string `json:"namespace" ch:"namespace"`
Id string `json:"id"`
Name string `json:"name" ch:"name"`
CommitID string `json:"commit_id" ch:"commit_id"`
Branch string `json:"branch,omitempty" ch:"branch"`
Actor string `json:"actor" ch:"actor"`
Tag string `json:"tag,omitempty" ch:"tag"`
Data json.RawMessage `json:"data" ch:"data"`
PublishedAt time.Time `json:"published_at" ch:"published_at"`
Source string `json:"source" ch:"source"`
RepositoryID string `json:"repository_id"`
URLx string `json:"url"`
OsArch []string `json:"os_arch" ch:"os_arch"`
Archive []*entity.File `json:"archive"`
}
TODO: we can make another entity that extend this, to get "BuildArtifactByBranch" ; todo: in dg
func (*BuildArtifact) CreatedTime ¶
func (a *BuildArtifact) CreatedTime() time.Time
func (*BuildArtifact) ID ¶
func (a *BuildArtifact) ID() string
func (*BuildArtifact) Namespace ¶
func (a *BuildArtifact) Namespace() string
func (*BuildArtifact) RefIDs ¶
func (a *BuildArtifact) RefIDs() []string
func (*BuildArtifact) URL ¶
func (a *BuildArtifact) URL() string
func (*BuildArtifact) Validate ¶
func (a *BuildArtifact) Validate() error
func (*BuildArtifact) WithCreatedTime ¶
func (a *BuildArtifact) WithCreatedTime(t time.Time) mycontent.Data
func (*BuildArtifact) WithEventID ¶
func (a *BuildArtifact) WithEventID(id uint64) mycontent.VersionedData
func (*BuildArtifact) WithNamespace ¶
func (a *BuildArtifact) WithNamespace(id string) mycontent.Data
type CancelJobRequest ¶
type ClickHouseStorageConfig ¶
type ClickHouseStorageConfig struct {
Address string `json:"address"`
}
type CloudflareConfig ¶
type CloudflareConfig struct {
TunnelToken string `json:"tunnel_token"`
}
type ClusterConfiguration ¶
type ConfigureHostJob ¶
type ConfigureHostJob struct {
Status map[string]HostConfigurationState `json:"status"`
}
type ConfirmDeployment ¶
type ContinueDeployment ¶
type DeploymentJob ¶
type DeploymentJob struct {
Ns string `json:"namespace"`
Id string `json:"id"`
// main status / DAG
Status DeploymentJobStatus `json:"status"`
RestartServiceJob RestartServiceJob `json:"restart_service_job"`
ConfigureHostJob ConfigureHostJob `json:"configure_host_job"`
// The request; when displaying can be omitted
Request *SubmitDeploymentJobRequest `json:"request,omitempty"`
// The target host in which we will deploy our service to;
// In dragonboat lingo, this would be the Nodes, as opossed to NonVotings, Witnesses, Removed member type.
// able to be omitted for display
Target []Host `json:"target,omitempty"`
RaftConfig *RaftConfig `json:"raft_config,omitempty"`
PendingUserAction *PendingUserAction `json:"pending_user_action,omitempty"`
Url string `json:"url"`
PublishedAt time.Time `json:"published_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
func (*DeploymentJob) CreatedTime ¶
func (d *DeploymentJob) CreatedTime() time.Time
func (*DeploymentJob) ID ¶
func (d *DeploymentJob) ID() string
func (*DeploymentJob) Namespace ¶
func (d *DeploymentJob) Namespace() string
func (*DeploymentJob) RefIDs ¶
func (d *DeploymentJob) RefIDs() []string
func (*DeploymentJob) URL ¶
func (d *DeploymentJob) URL() string
func (*DeploymentJob) Validate ¶
func (d *DeploymentJob) Validate() error
func (*DeploymentJob) WithCreatedTime ¶
func (d *DeploymentJob) WithCreatedTime(t time.Time) mycontent.Data
func (*DeploymentJob) WithNamespace ¶
func (d *DeploymentJob) WithNamespace(id string) mycontent.Data
type DeploymentJobByService ¶
type DeploymentJobByService struct {
*DeploymentJob
}
Limitation of DG framework; if you have an entity that can indexed many way, you need to make separate struct
func (*DeploymentJobByService) RefIDs ¶
func (d *DeploymentJobByService) RefIDs() []string
type DeploymentJobStatus ¶
type DeploymentJobStatus string
type Host ¶
type Host struct {
Ns string `json:"namespace"`
Host string `json:"host"`
Architecture string `json:"architecture"`
OS string `json:"os"`
FQDN string `json:"fqdn"`
RaftConfig RaftHostConfig `json:"raft_config"`
PublishedAt time.Time `json:"published_at"`
URLx string `json:"url"`
}
Host represents raft host configuration for a particular service
func (*Host) CreatedTime ¶
type HostConfigurationState ¶
type HostConfigurationState struct {
ErrorMessage *string `json:"error_message,omitempty"`
Status HostConfigurationStatus `json:"status"`
URL string `json:"url,omitempty"` // url with job id to stream log from
JobID string `json:"job_id,omitempty"`
}
type HostConfigurationStatus ¶
type HostConfigurationStatus string
type HostDeploymentJob ¶
type HostDeploymentJob struct {
*DeploymentJob
Status HostRestartServiceStatus `json:"status"`
}
type HostRestartServiceState ¶
type HostRestartServiceState struct {
ErrorMessage *string `json:"error_message,omitempty"`
Status HostRestartServiceStatus `json:"status"`
URL string `json:"url,omitempty"` // url with job id to stream log from
JobID string `json:"job_id,omitempty"`
}
type HostRestartServiceStatus ¶
type HostRestartServiceStatus string
type KV ¶
type KV struct {
Ns string `json:"namespace"`
Service string `json:"service"`
Version string `json:"version"`
Value map[string]string `json:"value"`
PublishedAt time.Time `json:"published_at" ch:"published_at"`
URLx string `json:"url"`
}
Represents key-value pair
func (*KV) CreatedTime ¶
type PendingUserAction ¶
type PendingUserAction struct {
// after configuration finish
ConfirmDeployment *ConfirmDeployment `json:"confirm_deployment,omitempty"`
ContinueDeployment *ContinueDeployment `json:"continue_deployment,omitempty"`
}
For front end to render the CTA, if "believe"(aka.auto confirm) is not specified
type RaftConfig ¶
type RaftConfig struct {
Service map[string]RaftServiceConfig `json:"service,omitempty"`
Shards map[uint64]RaftShardConfig `json:"shards,omitempty"`
}
type RaftHost ¶
type RaftHost struct {
Id string `json:"id,omitempty"`
Ns string `json:"namespace" ch:"namespace"`
ServiceID string `json:"service_id"`
ReplicaID uint64 `json:"replica_id"`
RaftAdress string `json:"raft_address"`
WALDir string `json:"wal_dir"`
NodeHostDir string `json:"node_host_dir"`
RTTMillisecond uint64 `json:"rtt_millisecond"`
DeploymentID uint64 `json:"deployment_id"`
PublishedAt time.Time `json:"published_at" ch:"published_at"`
URLx string `json:"url"`
}
RaftHost represents raft host configuration for a particular service
func (*RaftHost) CreatedTime ¶
type RaftHostConfig ¶
type RaftReplica ¶
type RaftReplica struct {
Id string `json:"id,omitempty"`
Ns string `json:"namespace" ch:"namespace"`
ServiceID string `json:"service_id"`
ReplicaConfig map[uint64]ReplicaConfig `json:"replica_config"`
PublishedAt time.Time `json:"published_at" ch:"published_at"`
URLx string `json:"url"`
}
RaftReplica represents raft replica configuration for a particular service
func (*RaftReplica) CreatedTime ¶
func (a *RaftReplica) CreatedTime() time.Time
func (*RaftReplica) ID ¶
func (a *RaftReplica) ID() string
func (*RaftReplica) Namespace ¶
func (a *RaftReplica) Namespace() string
func (*RaftReplica) RefIDs ¶
func (a *RaftReplica) RefIDs() []string
func (*RaftReplica) URL ¶
func (a *RaftReplica) URL() string
func (*RaftReplica) Validate ¶
func (a *RaftReplica) Validate() error
func (*RaftReplica) WithCreatedTime ¶
func (a *RaftReplica) WithCreatedTime(t time.Time) mycontent.Data
func (*RaftReplica) WithNamespace ¶
func (a *RaftReplica) WithNamespace(id string) mycontent.Data
type RaftServiceConfig ¶
type RaftShardConfig ¶
type ReplicaConfig ¶
type Repository ¶
type Repository struct {
Id string `json:"id"`
Ns string `json:"namespace"`
Name string `json:"name"`
Source string `json:"source"`
PublishedAt time.Time `json:"published_at"`
URLx string `json:"url"`
}
func (*Repository) CreatedTime ¶
func (r *Repository) CreatedTime() time.Time
func (*Repository) ID ¶
func (r *Repository) ID() string
func (*Repository) Namespace ¶
func (r *Repository) Namespace() string
func (*Repository) RefIDs ¶
func (r *Repository) RefIDs() []string
func (*Repository) URL ¶
func (r *Repository) URL() string
func (*Repository) Validate ¶
func (r *Repository) Validate() error
func (*Repository) WithCreatedTime ¶
func (r *Repository) WithCreatedTime(t time.Time) mycontent.Data
func (*Repository) WithNamespace ¶
func (r *Repository) WithNamespace(id string) mycontent.Data
type RestartServiceJob ¶
type Routing ¶
type Routing struct {
Ns string `json:"namespace"`
Service string `json:"service"`
Version string `json:"version"`
CloudflareConfig *CloudflareConfig `json:"cloudflare_config,omitempty"`
PublishedAt time.Time `json:"published_at"`
URLx string `json:"url"`
}
Routing represents cloudflare config
func (*Routing) CreatedTime ¶
type Secret ¶
type Secret struct {
KV
}
Test composition, if it's awkward in the API, might need to create new struct
type ServiceDefinition ¶
type ServiceDefinition struct {
Ns string `json:"namespace"`
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Repository ArtifactdRepository `json:"repository"`
ExecutablePath string `json:"executable_path"` // todo add validation
BoundAddresses []BoundAddress `json:"bound_addresses"`
PublishedAt time.Time `json:"published_at"`
URLx string `json:"url"`
}
func (*ServiceDefinition) CreatedTime ¶
func (a *ServiceDefinition) CreatedTime() time.Time
func (*ServiceDefinition) ID ¶
func (a *ServiceDefinition) ID() string
func (*ServiceDefinition) Namespace ¶
func (a *ServiceDefinition) Namespace() string
func (*ServiceDefinition) RefIDs ¶
func (a *ServiceDefinition) RefIDs() []string
func (*ServiceDefinition) URL ¶
func (a *ServiceDefinition) URL() string
func (*ServiceDefinition) Validate ¶
func (a *ServiceDefinition) Validate() error
func (*ServiceDefinition) WithCreatedTime ¶
func (a *ServiceDefinition) WithCreatedTime(t time.Time) mycontent.Data
func (*ServiceDefinition) WithNamespace ¶
func (a *ServiceDefinition) WithNamespace(id string) mycontent.Data
type ServiceInstanceHost ¶
type ServiceInstanceHost struct {
Ns string `json:"namespace"`
Service string `json:"service"` // service
Host string `json:"host"` // where is this deployed, the ID
RaftConfig *RaftConfig `json:"raft_config,omitempty"`
// current on progress deployment (if any)
ActiveDeployment *HostDeploymentJob `json:"active_deployment,omitempty"`
LatestDeployment *HostDeploymentJob `json:"latest_deployment,omitempty"`
PublishedAt time.Time `json:"published_at"`
URLx string `json:"url"`
}
RaftHost represents raft host configuration for a particular service
func (*ServiceInstanceHost) CreatedTime ¶
func (a *ServiceInstanceHost) CreatedTime() time.Time
func (*ServiceInstanceHost) ID ¶
func (a *ServiceInstanceHost) ID() string
func (*ServiceInstanceHost) Namespace ¶
func (a *ServiceInstanceHost) Namespace() string
func (*ServiceInstanceHost) RefIDs ¶
func (a *ServiceInstanceHost) RefIDs() []string
func (*ServiceInstanceHost) URL ¶
func (a *ServiceInstanceHost) URL() string
func (*ServiceInstanceHost) Validate ¶
func (a *ServiceInstanceHost) Validate() error
func (*ServiceInstanceHost) WithCreatedTime ¶
func (a *ServiceInstanceHost) WithCreatedTime(t time.Time) mycontent.Data
func (*ServiceInstanceHost) WithNamespace ¶
func (a *ServiceInstanceHost) WithNamespace(id string) mycontent.Data
type StorageConfiguration ¶
type StorageConfiguration struct {
Clickhouse ClickHouseStorageConfig `json:"clickhouse"`
}
type SubmitDeploymentJobRequest ¶
type SubmitDeploymentJobRequest struct {
Ns string `json:"namespace"`
Service ServiceDefinition `json:"service"`
Id string `json:"id"`
BuildVersion uint64 `json:"build_version"`
SecretVersion uint64 `json:"secret_version"`
EnvVersion uint64 `json:"env_version"`
// optional: lookup configure cloudflare routing
RoutingVersion *uint64 `json:"routing_version,omitempty"`
// TODO: List of hosts to deploy to; for first time deployment
TargetHosts []Host `json:"target_hosts,omitempty"`
// Register (new) replica at the deployment time.
RaftShard map[uint64]RaftShardConfig `json:"raft_shard,omitempty"`
RaftPort uint16 `json:"raft_port"`
RaftPortMapping map[string]uint16 `json:"raft_port_mapping,omitempty"` // optional if at each host, the port is different
RaftDeploymentID uint64 `json:"raft_deployment_id"`
ModifyKey *string `json:"-"` // hidden; TODO: to be nice, to lock, only the one who have this key can modify the state.
TimeoutSeconds *uint32 `json:"timeout_seconds,omitempty"`
IsBelieve bool `json:"is_believe"`
Url string `json:"url"`
PublishedAt time.Time `json:"published_at"`
}