entity

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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 ArtifactdRepository struct {
	URL string `json:"url"`       // in case external
	Ns  string `json:"namespace"` // in case external
	ID  string `json:"id"`
}

type BoundAddress

type BoundAddress struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

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) DGVersion

func (a *BuildArtifact) DGVersion() *uint64

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) WithID

func (a *BuildArtifact) WithID(id string) mycontent.Data

func (*BuildArtifact) WithNamespace

func (a *BuildArtifact) WithNamespace(id string) mycontent.Data

func (*BuildArtifact) WithURL

func (a *BuildArtifact) WithURL(url string) mycontent.Data

func (*BuildArtifact) WithVersion

func (a *BuildArtifact) WithVersion(ver uint64) mycontent.Data

type CancelJobRequest

type CancelJobRequest struct {
	Ns      string `json:"namespace"`
	Id      string `json:"id"`
	Service string `json:"service"`
}

type ClickHouseStorageConfig

type ClickHouseStorageConfig struct {
	Address string `json:"address"`
}

type CloudflareConfig

type CloudflareConfig struct {
	TunnelToken string `json:"tunnel_token"`
}

type ClusterConfiguration

type ClusterConfiguration struct {
	OS      string `json:"os"`
	Arch    string `json:"arch"`
	RaftDir string `json:"raft_dir"`
}

type ConfigureHostJob

type ConfigureHostJob struct {
	Status map[string]HostConfigurationState `json:"status"`
}

type ConfigureWebsiteRequest added in v0.0.3

type ConfigureWebsiteRequest struct {
	// Website host name eg. example.com
	WebsiteHostAddress string `json:"website_host_address"`

	// artifactd repository ID
	RepositoryID string `json:"repository_id"`

	// build ID
	BuildID string `json:"build_id"`

	// Will ignore aritfactd repository ID & build id, will open from this URL instead
	// Currently only support tar.gz archive.
	FromUrl *string `json:"from_url,omitempty"`

	// Captured host info in which the configuration will be applied
	TargetHosts map[string]*Host `json:"target_hosts,omitempty"`

	// <host>:<port> from target hosts
	ListenAddress map[string]string `json:"listen_address,omitempty"`

	Custom404Page string `json:"custom_404_page,omitempty"`

	Time time.Time `json:"time,omitempty"`
}

type ConfirmDeployment

type ConfirmDeployment struct {
	Message        string
	CTAButtonLabel string
}

type ContinueDeployment

type ContinueDeployment struct {
	Message    string
	TargetHost string
}

type DeploymentJob

type DeploymentJob struct {
	Ns string `json:"namespace"`
	Id string `json:"id"` // it's a version (auto increment)

	// 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) DGVersion

func (d *DeploymentJob) DGVersion() *uint64

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) WithID

func (d *DeploymentJob) WithID(id string) mycontent.Data

func (*DeploymentJob) WithNamespace

func (d *DeploymentJob) WithNamespace(id string) mycontent.Data

func (*DeploymentJob) WithURL

func (d *DeploymentJob) WithURL(url string) mycontent.Data

func (*DeploymentJob) WithVersion

func (d *DeploymentJob) WithVersion(ver uint64) 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 Env

type Env struct {
	KV
}

type EtcdRaftReplicaConfig

type EtcdRaftReplicaConfig struct {
	AssignedPort uint16 `json:"assigned_port"`
	Join         bool   `json:"join"`
}

type Host

type Host struct {
	Ns string `json:"namespace"`

	Id uint32 `json:"id"`
	// Hostname
	Host string `json:"host"`

	// internal host address for intra cluster-communication
	InternalAddress string `json:"internal_address"`

	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

func (a *Host) CreatedTime() time.Time

func (*Host) DGVersion

func (a *Host) DGVersion() *uint64

func (*Host) ID

func (a *Host) ID() string

func (*Host) Namespace

func (a *Host) Namespace() string

func (*Host) RefIDs

func (a *Host) RefIDs() []string

func (*Host) URL

func (a *Host) URL() string

func (*Host) Validate

func (a *Host) Validate() error

func (*Host) WithCreatedTime

func (a *Host) WithCreatedTime(t time.Time) mycontent.Data

func (*Host) WithID

func (a *Host) WithID(id string) mycontent.Data

func (*Host) WithNamespace

func (a *Host) WithNamespace(id string) mycontent.Data

func (*Host) WithURL

func (a *Host) WithURL(url string) mycontent.Data

func (*Host) WithVersion

func (a *Host) WithVersion(ver uint64) mycontent.Data

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 HostUpdateResult added in v0.0.3

type HostUpdateResult struct {
	Status  JobConfigureWebsiteStatus `json:"status"`
	Error   *string                   `json:"error,omitempty"`
	Message string                    `json:"message"`

	HostID string     `json:"host_id"`
	JobID  string     `json:"job_id"`
	Time   *time.Time `json:"time"`
}

type JobConfigureWebsite added in v0.0.3

type JobConfigureWebsite struct {
	Ns   string `json:"namespace"` // static: deployd
	Name string `json:"name"`      // static: configure-website

	Id string `json:"id"` // it's a version (auto increment)

	// main status / DAG
	Status string `json:"status"`

	Result map[string]*HostUpdateResult `json:"result"`

	Request ConfigureWebsiteRequest `json:"request"`

	Url         string     `json:"url"`
	PublishedAt time.Time  `json:"published_at"`
	FinishedAt  *time.Time `json:"finished_at,omitempty"`
}

func (*JobConfigureWebsite) CreatedTime added in v0.0.3

func (d *JobConfigureWebsite) CreatedTime() time.Time

func (*JobConfigureWebsite) DGVersion added in v0.0.3

func (d *JobConfigureWebsite) DGVersion() *uint64

func (*JobConfigureWebsite) ID added in v0.0.3

func (d *JobConfigureWebsite) ID() string

func (*JobConfigureWebsite) Namespace added in v0.0.3

func (d *JobConfigureWebsite) Namespace() string

func (*JobConfigureWebsite) RefIDs added in v0.0.3

func (d *JobConfigureWebsite) RefIDs() []string

func (*JobConfigureWebsite) URL added in v0.0.3

func (d *JobConfigureWebsite) URL() string

func (*JobConfigureWebsite) Validate added in v0.0.3

func (d *JobConfigureWebsite) Validate() error

func (*JobConfigureWebsite) WithCreatedTime added in v0.0.3

func (d *JobConfigureWebsite) WithCreatedTime(t time.Time) mycontent.Data

func (*JobConfigureWebsite) WithID added in v0.0.3

func (d *JobConfigureWebsite) WithID(id string) mycontent.Data

func (*JobConfigureWebsite) WithNamespace added in v0.0.3

func (d *JobConfigureWebsite) WithNamespace(id string) mycontent.Data

func (*JobConfigureWebsite) WithURL added in v0.0.3

func (d *JobConfigureWebsite) WithURL(url string) mycontent.Data

func (*JobConfigureWebsite) WithVersion added in v0.0.3

func (d *JobConfigureWebsite) WithVersion(ver uint64) mycontent.Data

type JobConfigureWebsiteResultByHost added in v0.0.3

type JobConfigureWebsiteResultByHost struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type JobConfigureWebsiteStatus added in v0.0.3

type JobConfigureWebsiteStatus string
const (
	// Overall status for the deployment job
	JobConfigureWebsiteStatusQueued      JobConfigureWebsiteStatus = "QUEUED"
	JobConfigureWebsiteStatusConfiguring JobConfigureWebsiteStatus = "CONFIGURING"
	JobConfigureWebsiteStatusConfigured  JobConfigureWebsiteStatus = "CONFIGURED"
	JobConfigureWebsiteStatusDeploying   JobConfigureWebsiteStatus = "DEPLOYING"
	JobConfigureWebsiteStatusDeployed    JobConfigureWebsiteStatus = "DEPLOYED"
	JobConfigureWebsiteStatusSuccess     JobConfigureWebsiteStatus = "SUCCESS"
	JobConfigureWebsiteStatusCancelled   JobConfigureWebsiteStatus = "CANCELLED"
	JobConfigureWebsiteStatusTimeOut     JobConfigureWebsiteStatus = "TIMEOUT"
	JobConfigureWebsiteStatusFailed      JobConfigureWebsiteStatus = "FAILED"
)

func (JobConfigureWebsiteStatus) IsTerminal added in v0.0.3

func (j JobConfigureWebsiteStatus) IsTerminal() bool

type KV

type KV struct {
	Ns      string `json:"namespace"`
	Service string `json:"service"`

	Id      string `json:"id"`
	Version uint64 `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

func (a *KV) CreatedTime() time.Time

func (*KV) DGVersion

func (a *KV) DGVersion() *uint64

func (*KV) ID

func (a *KV) ID() string

func (*KV) Namespace

func (a *KV) Namespace() string

func (*KV) RefIDs

func (a *KV) RefIDs() []string

func (*KV) URL

func (a *KV) URL() string

func (*KV) Validate

func (a *KV) Validate() error

func (*KV) WithCreatedTime

func (a *KV) WithCreatedTime(t time.Time) mycontent.Data

func (*KV) WithID

func (a *KV) WithID(id string) mycontent.Data

func (*KV) WithNamespace

func (a *KV) WithNamespace(ns string) mycontent.Data

func (*KV) WithURL

func (a *KV) WithURL(url string) mycontent.Data

func (*KV) WithVersion

func (a *KV) WithVersion(ver uint64) mycontent.Data

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"` // dist
	Shards           map[uint64]RaftShardConfig       `json:"shards,omitempty"`  // dist
	EtcdRaftReplicas map[string]EtcdRaftReplicaConfig `json:"etcd_raft_replicas,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

func (a *RaftHost) CreatedTime() time.Time

func (*RaftHost) DGVersion

func (a *RaftHost) DGVersion() *uint64

func (*RaftHost) ID

func (a *RaftHost) ID() string

func (*RaftHost) Namespace

func (a *RaftHost) Namespace() string

func (*RaftHost) RefIDs

func (a *RaftHost) RefIDs() []string

func (*RaftHost) URL

func (a *RaftHost) URL() string

func (*RaftHost) Validate

func (a *RaftHost) Validate() error

func (*RaftHost) WithCreatedTime

func (a *RaftHost) WithCreatedTime(t time.Time) mycontent.Data

func (*RaftHost) WithID

func (a *RaftHost) WithID(id string) mycontent.Data

func (*RaftHost) WithNamespace

func (a *RaftHost) WithNamespace(id string) mycontent.Data

func (*RaftHost) WithURL

func (a *RaftHost) WithURL(url string) mycontent.Data

func (*RaftHost) WithVersion

func (a *RaftHost) WithVersion(ver uint64) mycontent.Data

type RaftHostConfig

type RaftHostConfig struct {
	ReplicaID       uint64 `json:"replica_id"`
	BaseWALDir      string `json:"base_wal_dir"`
	BaseNodeHostDir string `json:"base_node_host_dir"`
	RTTMillisecond  uint64 `json:"rtt_millisecond"`
}

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) DGVersion

func (a *RaftReplica) DGVersion() *uint64

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) WithID

func (a *RaftReplica) WithID(id string) mycontent.Data

func (*RaftReplica) WithNamespace

func (a *RaftReplica) WithNamespace(id string) mycontent.Data

func (*RaftReplica) WithURL

func (a *RaftReplica) WithURL(url string) mycontent.Data

func (*RaftReplica) WithVersion

func (a *RaftReplica) WithVersion(ver uint64) mycontent.Data

type RaftServiceConfig

type RaftServiceConfig struct {
	ReplicaID    uint64 `json:"replica_id"` // convenience from host
	DeploymentID uint64 `json:"deployment_id"`
	RaftAddress  string `json:"raft_address"`
}

type RaftShardConfig

type RaftShardConfig struct {
	BootstrapHost string `json:"bootstrap_host"` // overwritten in http integration
	ShardID       uint64 `json:"shard_id"`
	ID            string `json:"id"`
	Type          string `json:"type"`
	Description   string `json:"description"`
}

type ReplicaConfig

type ReplicaConfig struct {
	ID          string          `json:"id"`
	ReplicaID   uint64          `json:"replica_id"`
	Alias       string          `json:"alias"`
	Description string          `json:"description"`
	Type        string          `json:"type"`
	Config      json.RawMessage `json:"config"`
}

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) DGVersion

func (a *Repository) DGVersion() *uint64

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) WithID

func (r *Repository) WithID(id string) mycontent.Data

func (*Repository) WithNamespace

func (r *Repository) WithNamespace(id string) mycontent.Data

func (*Repository) WithURL

func (r *Repository) WithURL(url string) mycontent.Data

func (*Repository) WithVersion

func (a *Repository) WithVersion(ver uint64) mycontent.Data

type RestartServiceJob

type RestartServiceJob struct {
	ConfirmedBy  string                             `json:"confirmed_by,omitempty"`
	CurrentOrder *uint                              `json:"current_order,omitempty"`
	HostOrder    []string                           `json:"host_order"`
	Status       map[string]HostRestartServiceState `json:"status"`
	ConfirmedAt  *time.Time                         `json:"confirmed_at,omitempty"`
}

type Routing

type Routing struct {
	Ns      string `json:"namespace"`
	Service string `json:"service"`
	Id      string `json:"id"`
	Version uint64 `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

func (c *Routing) CreatedTime() time.Time

func (*Routing) DGVersion

func (a *Routing) DGVersion() *uint64

func (*Routing) ID

func (c *Routing) ID() string

func (*Routing) Namespace

func (c *Routing) Namespace() string

func (*Routing) RefIDs

func (c *Routing) RefIDs() []string

func (*Routing) URL

func (c *Routing) URL() string

func (*Routing) Validate

func (c *Routing) Validate() error

func (*Routing) WithCreatedTime

func (c *Routing) WithCreatedTime(t time.Time) mycontent.Data

func (*Routing) WithID

func (c *Routing) WithID(id string) mycontent.Data

func (*Routing) WithNamespace

func (c *Routing) WithNamespace(ns string) mycontent.Data

func (*Routing) WithURL

func (c *Routing) WithURL(url string) mycontent.Data

func (*Routing) WithVersion

func (a *Routing) WithVersion(ver uint64) mycontent.Data

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) DGVersion

func (a *ServiceDefinition) DGVersion() *uint64

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) WithID

func (a *ServiceDefinition) WithID(id string) mycontent.Data

func (*ServiceDefinition) WithNamespace

func (a *ServiceDefinition) WithNamespace(id string) mycontent.Data

func (*ServiceDefinition) WithURL

func (a *ServiceDefinition) WithURL(url string) mycontent.Data

func (*ServiceDefinition) WithVersion

func (a *ServiceDefinition) WithVersion(ver uint64) 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) DGVersion

func (a *ServiceInstanceHost) DGVersion() *uint64

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) WithID

func (a *ServiceInstanceHost) WithID(id string) mycontent.Data

func (*ServiceInstanceHost) WithNamespace

func (a *ServiceInstanceHost) WithNamespace(id string) mycontent.Data

func (*ServiceInstanceHost) WithURL

func (a *ServiceInstanceHost) WithURL(url string) mycontent.Data

func (*ServiceInstanceHost) WithVersion

func (a *ServiceInstanceHost) WithVersion(ver uint64) 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"`

	// ETCDMAXXING
	EtcdRaftReplicas []string `json:"etcd_raft_replicas"`

	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"`
}

Jump to

Keyboard shortcuts

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