client

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package client implements the PipyRepo struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Basepath string
	Items    []BatchItem
}

Batch submits multiple resources at once

type BatchItem

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

BatchItem is a resource wrapper

type Codebase

type Codebase struct {
	Version     string   `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"`
}

Codebase is Pipy's logic unit

type PipyRepoClient

type PipyRepoClient struct {
	Restore func() error
	// contains filtered or unexported fields
}

PipyRepoClient Pipy Repo Client

func NewRepoClient

func NewRepoClient(serverAddr string, serverPort uint16) *PipyRepoClient

NewRepoClient creates a Repo Client

func NewRepoClientWithAPIBaseURLAndTransport

func NewRepoClientWithAPIBaseURLAndTransport(serverAddr string, serverPort uint16, transport *http.Transport) *PipyRepoClient

NewRepoClientWithAPIBaseURLAndTransport creates a Repo Client with ApiBaseUrl and Transport

func NewRepoClientWithTransport

func NewRepoClientWithTransport(serverAddr string, serverPort uint16, transport *http.Transport) *PipyRepoClient

NewRepoClientWithTransport creates a Repo Client with Transport

func (*PipyRepoClient) Batch

func (p *PipyRepoClient) Batch(version string, batches []Batch) (success bool, err error)

Batch submits multiple resources at once

func (*PipyRepoClient) CodebaseExists added in v1.1.0

func (p *PipyRepoClient) CodebaseExists(path string) bool

CodebaseExists checks whether the codebase exists

func (*PipyRepoClient) Delete

func (p *PipyRepoClient) Delete(codebaseName string) (success bool, err error)

Delete codebase

func (*PipyRepoClient) DeriveCodebase

func (p *PipyRepoClient) DeriveCodebase(codebaseName, base string, version uint64) (success bool, err error)

DeriveCodebase derives Codebase

func (*PipyRepoClient) GetCodebase

func (p *PipyRepoClient) GetCodebase(codebaseName string) (success bool, codebase *Codebase, err error)

GetCodebase retrieves Codebase

func (*PipyRepoClient) GetFile added in v1.1.0

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

GetFile gets the file content from repo

func (*PipyRepoClient) IsRepoUp

func (p *PipyRepoClient) IsRepoUp() (success bool, err error)

IsRepoUp checks whether the repo is up

Jump to

Keyboard shortcuts

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