apiserver

package
v0.0.0-...-57fe098 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package apiserver contains the implementations of the gRPC services provided by the daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(socket string) (net.Listener, error)

Listen starts a listener on the given unix socket.

It deletes the socket file if it already exists.

Types

type Server

type Server struct {
	Version    string
	PID        int
	SourceList source.List
	Cloner     *source.Cloner
	Suggester  *source.Suggester
	Log        logs.Log
}

Server is the implementation of api.APIServer

func (*Server) CloneRepo

func (s *Server) CloneRepo(
	req *api.CloneRepoRequest,
	stream api.API_CloneRepoServer,
) error

CloneRepo makes a local clone of a repository from a source.

func (*Server) DaemonInfo

func (s *Server) DaemonInfo(
	ctx context.Context,
	req *api.DaemonInfoRequest,
) (*api.DaemonInfoResponse, error)

DaemonInfo returns information about the daemon.

func (*Server) ListSources

func (s *Server) ListSources(
	ctx context.Context,
	_ *api.ListSourcesRequest,
) (*api.ListSourcesResponse, error)

ListSources lists the configured repository sources.

func (*Server) ResolveRepo

func (s *Server) ResolveRepo(
	req *api.ResolveRepoRequest,
	responses api.API_ResolveRepoServer,
) error

ResolveRepo resolves a repository name, URL or other identifier to a list of repositories.

func (*Server) SignIn

func (s *Server) SignIn(
	req *api.SignInRequest,
	stream api.API_SignInServer,
) error

SignIn signs in to a repository source.

func (*Server) SignOut

func (s *Server) SignOut(
	ctx context.Context,
	req *api.SignOutRequest,
) (*api.SignOutResponse, error)

SignOut signs out of a repository source.

func (*Server) SuggestRepos

func (s *Server) SuggestRepos(
	ctx context.Context,
	req *api.SuggestReposRequest,
) (*api.SuggestResponse, error)

SuggestRepos returns a list of repository names to be used as suggestions for completing a partial repository name.

Jump to

Keyboard shortcuts

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