repo

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PipyRepoApiBaseUrlTemplate = "%s://%s" + commons.DefaultPipyRepoApiPath
	IngressPath                = "/ingress"
	ServiceBasePath            = "/service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgoBalancer

type AlgoBalancer string
const (
	RoundRobinLoadBalancer AlgoBalancer = "RoundRobinLoadBalancer"
	HashingLoadBalancer    AlgoBalancer = "HashingLoadBalancer"
	LeastWorkLoadBalancer  AlgoBalancer = "LeastWorkLoadBalancer"
)

type Balancer

type Balancer struct {
	Services BalancerEntry `json:"services"`
}

type BalancerEntry

type BalancerEntry map[string]Upstream

type Batch

type Batch struct {
	Basepath string
	Items    []BatchItem
}

type BatchItem

type BatchItem struct {
	Path     string
	Filename string
	Content  interface{}
}

type Codebase

type Codebase struct {
	Version     int64    `json:"version,omitempty"`
	Path        string   `json:"path,omitempty"`
	Main        string   `json:"main,omitempty"`
	Base        string   `json:"base,omitempty"`
	Files       []string `json:"files,omitempty"`
	EditFiles   []string `json:"editFiles,omitempty"`
	ErasedFiles []string `json:"erasedFiles,omitempty"`
	Derived     []string `json:"derived,omitempty"`
}

type PipyRepoClient

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

func NewRepoClient

func NewRepoClient(repoRootAddr string) *PipyRepoClient

func NewRepoClientWithApiBaseUrl

func NewRepoClientWithApiBaseUrl(repoApiBaseUrl string) *PipyRepoClient

func NewRepoClientWithApiBaseUrlAndTransport

func NewRepoClientWithApiBaseUrlAndTransport(repoApiBaseUrl string, transport *http.Transport) *PipyRepoClient

func NewRepoClientWithTransport

func NewRepoClientWithTransport(repoRootAddr string, transport *http.Transport) *PipyRepoClient

func (*PipyRepoClient) Batch

func (p *PipyRepoClient) Batch(batches []Batch) error

func (*PipyRepoClient) DeriveCodebase

func (p *PipyRepoClient) DeriveCodebase(path, base string) error

func (*PipyRepoClient) GetFile

func (p *PipyRepoClient) GetFile(path string) (string, error)

func (*PipyRepoClient) IsRepoUp

func (p *PipyRepoClient) IsRepoUp() bool

func (*PipyRepoClient) SwitchMain added in v0.1.6

func (p *PipyRepoClient) SwitchMain(path, main string) error

type Router

type Router struct {
	Routes RouterEntry `json:"routes"`
}

type RouterEntry

type RouterEntry map[string]ServiceInfo

type ServiceInfo

type ServiceInfo struct {
	Service string   `json:"service,omitempty"`
	Rewrite []string `json:"rewrite,omitempty"`
}

type ServiceRegistry

type ServiceRegistry struct {
	Services ServiceRegistryEntry `json:"services"`
}

type ServiceRegistryEntry

type ServiceRegistryEntry map[string][]string

TODO: change the type to map[string][]Targets

type Target

type Target struct {
	Address string            `json:"address"`
	Tags    map[string]string `json:"tags,omitempty"`
}

type Upstream

type Upstream struct {
	Targets  []string     `json:"targets"`
	Balancer AlgoBalancer `json:"balancer,omitempty"`
	Sticky   bool         `json:"sticky,omitempty"`
}

TODO: change the type to Targets []Target

Jump to

Keyboard shortcuts

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