repo

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package repo is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.1.

It is generated from these files:

repo.proto

Index

Constants

View Source
const RepoPathPrefix = "/twirp/redsail.bosn.Repo/"

RepoPathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var (
	RepoType_name = map[int32]string{
		0: "HELM_REPO",
		1: "GIT_REPO",
	}
	RepoType_value = map[string]int32{
		"HELM_REPO": 0,
		"GIT_REPO":  1,
	}
)

Enum value maps for RepoType.

View Source
var (
	AuthType_name = map[int32]string{
		0: "CREDENTIALS",
		1: "TOKEN",
	}
	AuthType_value = map[string]int32{
		"CREDENTIALS": 0,
		"TOKEN":       1,
	}
)

Enum value maps for AuthType.

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type AuthType added in v0.8.2

type AuthType int32
const (
	AuthType_CREDENTIALS AuthType = 0
	AuthType_TOKEN       AuthType = 1
)

func (AuthType) Descriptor added in v0.8.2

func (AuthType) Descriptor() protoreflect.EnumDescriptor

func (AuthType) Enum added in v0.8.2

func (x AuthType) Enum() *AuthType

func (AuthType) EnumDescriptor deprecated added in v0.8.2

func (AuthType) EnumDescriptor() ([]byte, []int)

Deprecated: Use AuthType.Descriptor instead.

func (AuthType) Number added in v0.8.2

func (x AuthType) Number() protoreflect.EnumNumber

func (AuthType) String added in v0.8.2

func (x AuthType) String() string

func (AuthType) Type added in v0.8.2

type CreateRepo

type CreateRepo struct {
	Name     string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                             // name of the repo
	Endpoint string   `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`                     // repo endpoint
	Type     RepoType `protobuf:"varint,3,opt,name=type,proto3,enum=redsail.bosn.RepoType" json:"type,omitempty"` // type of repo
	Token    string   `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`                           // an auth token (if required for this repo)
	Username string   `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"`                     // a username to login with
	Password string   `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`                     // a password to login with
	HelmOci  bool     `protobuf:"varint,7,opt,name=helm_oci,json=helmOci,proto3" json:"helm_oci,omitempty"`       // whether or not this is an OCI registry rather than a typical helm registry
	// contains filtered or unexported fields
}

func (*CreateRepo) Descriptor deprecated

func (*CreateRepo) Descriptor() ([]byte, []int)

Deprecated: Use CreateRepo.ProtoReflect.Descriptor instead.

func (*CreateRepo) GetEndpoint

func (x *CreateRepo) GetEndpoint() string

func (*CreateRepo) GetHelmOci added in v0.8.2

func (x *CreateRepo) GetHelmOci() bool

func (*CreateRepo) GetName

func (x *CreateRepo) GetName() string

func (*CreateRepo) GetPassword added in v0.8.2

func (x *CreateRepo) GetPassword() string

func (*CreateRepo) GetToken added in v0.5.0

func (x *CreateRepo) GetToken() string

func (*CreateRepo) GetType added in v0.4.0

func (x *CreateRepo) GetType() RepoType

func (*CreateRepo) GetUsername added in v0.8.2

func (x *CreateRepo) GetUsername() string

func (*CreateRepo) ProtoMessage

func (*CreateRepo) ProtoMessage()

func (*CreateRepo) ProtoReflect

func (x *CreateRepo) ProtoReflect() protoreflect.Message

func (*CreateRepo) Reset

func (x *CreateRepo) Reset()

func (*CreateRepo) String

func (x *CreateRepo) String() string

type DestroyRepo

type DestroyRepo struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // unique id of the repo
	// contains filtered or unexported fields
}

func (*DestroyRepo) Descriptor deprecated

func (*DestroyRepo) Descriptor() ([]byte, []int)

Deprecated: Use DestroyRepo.ProtoReflect.Descriptor instead.

func (*DestroyRepo) GetUuid

func (x *DestroyRepo) GetUuid() string

func (*DestroyRepo) ProtoMessage

func (*DestroyRepo) ProtoMessage()

func (*DestroyRepo) ProtoReflect

func (x *DestroyRepo) ProtoReflect() protoreflect.Message

func (*DestroyRepo) Reset

func (x *DestroyRepo) Reset()

func (*DestroyRepo) String

func (x *DestroyRepo) String() string

type FileRead added in v0.4.0

type FileRead struct {
	File []byte `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` // the contents of the file read
	// contains filtered or unexported fields
}

func (*FileRead) Descriptor deprecated added in v0.4.0

func (*FileRead) Descriptor() ([]byte, []int)

Deprecated: Use FileRead.ProtoReflect.Descriptor instead.

func (*FileRead) GetFile added in v0.4.0

func (x *FileRead) GetFile() []byte

func (*FileRead) ProtoMessage added in v0.4.0

func (*FileRead) ProtoMessage()

func (*FileRead) ProtoReflect added in v0.4.0

func (x *FileRead) ProtoReflect() protoreflect.Message

func (*FileRead) Reset added in v0.4.0

func (x *FileRead) Reset()

func (*FileRead) String added in v0.4.0

func (x *FileRead) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type ReadFile added in v0.4.0

type ReadFile struct {
	RepoId   string `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"`       // unique id of the repo
	Branch   string `protobuf:"bytes,2,opt,name=branch,proto3" json:"branch,omitempty"`                     // the branch to read the file from
	FilePath string `protobuf:"bytes,3,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` // relative path to the file
	// contains filtered or unexported fields
}

func (*ReadFile) Descriptor deprecated added in v0.4.0

func (*ReadFile) Descriptor() ([]byte, []int)

Deprecated: Use ReadFile.ProtoReflect.Descriptor instead.

func (*ReadFile) GetBranch added in v0.4.0

func (x *ReadFile) GetBranch() string

func (*ReadFile) GetFilePath added in v0.4.0

func (x *ReadFile) GetFilePath() string

func (*ReadFile) GetRepoId added in v0.4.0

func (x *ReadFile) GetRepoId() string

func (*ReadFile) ProtoMessage added in v0.4.0

func (*ReadFile) ProtoMessage()

func (*ReadFile) ProtoReflect added in v0.4.0

func (x *ReadFile) ProtoReflect() protoreflect.Message

func (*ReadFile) Reset added in v0.4.0

func (x *ReadFile) Reset()

func (*ReadFile) String added in v0.4.0

func (x *ReadFile) String() string

type ReadRepo

type ReadRepo struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // unique id of the repo
	// contains filtered or unexported fields
}

func (*ReadRepo) Descriptor deprecated

func (*ReadRepo) Descriptor() ([]byte, []int)

Deprecated: Use ReadRepo.ProtoReflect.Descriptor instead.

func (*ReadRepo) GetUuid

func (x *ReadRepo) GetUuid() string

func (*ReadRepo) ProtoMessage

func (*ReadRepo) ProtoMessage()

func (*ReadRepo) ProtoReflect

func (x *ReadRepo) ProtoReflect() protoreflect.Message

func (*ReadRepo) Reset

func (x *ReadRepo) Reset()

func (*ReadRepo) String

func (x *ReadRepo) String() string

type ReadRepos

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

func (*ReadRepos) Descriptor deprecated

func (*ReadRepos) Descriptor() ([]byte, []int)

Deprecated: Use ReadRepos.ProtoReflect.Descriptor instead.

func (*ReadRepos) ProtoMessage

func (*ReadRepos) ProtoMessage()

func (*ReadRepos) ProtoReflect

func (x *ReadRepos) ProtoReflect() protoreflect.Message

func (*ReadRepos) Reset

func (x *ReadRepos) Reset()

func (*ReadRepos) String

func (x *ReadRepos) String() string

type Repo

type Repo interface {
	// adds a repo to the list of configurations
	Create(context.Context, *CreateRepo) (*RepoCreated, error)

	// edits an already existing repo
	Update(context.Context, *UpdateRepo) (*RepoUpdated, error)

	// removes a repo from the list of configurations
	Destroy(context.Context, *DestroyRepo) (*RepoDestroyed, error)

	// reads out a repo
	Read(context.Context, *ReadRepo) (*RepoRead, error)

	// gets all repos currently configured and their status
	All(context.Context, *ReadRepos) (*ReposRead, error)

	// gets the contents of a file from this git repository
	File(context.Context, *ReadFile) (*FileRead, error)
}

func NewRepoJSONClient

func NewRepoJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Repo

NewRepoJSONClient creates a JSON client that implements the Repo interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewRepoProtobufClient

func NewRepoProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Repo

NewRepoProtobufClient creates a Protobuf client that implements the Repo interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type RepoCreated

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

func (*RepoCreated) Descriptor deprecated

func (*RepoCreated) Descriptor() ([]byte, []int)

Deprecated: Use RepoCreated.ProtoReflect.Descriptor instead.

func (*RepoCreated) ProtoMessage

func (*RepoCreated) ProtoMessage()

func (*RepoCreated) ProtoReflect

func (x *RepoCreated) ProtoReflect() protoreflect.Message

func (*RepoCreated) Reset

func (x *RepoCreated) Reset()

func (*RepoCreated) String

func (x *RepoCreated) String() string

type RepoDestroyed

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

func (*RepoDestroyed) Descriptor deprecated

func (*RepoDestroyed) Descriptor() ([]byte, []int)

Deprecated: Use RepoDestroyed.ProtoReflect.Descriptor instead.

func (*RepoDestroyed) ProtoMessage

func (*RepoDestroyed) ProtoMessage()

func (*RepoDestroyed) ProtoReflect

func (x *RepoDestroyed) ProtoReflect() protoreflect.Message

func (*RepoDestroyed) Reset

func (x *RepoDestroyed) Reset()

func (*RepoDestroyed) String

func (x *RepoDestroyed) String() string

type RepoRead

type RepoRead struct {
	Uuid     string   `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`                             // unique id of the repo
	Name     string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                             // name of the repo
	Endpoint string   `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`                     // repo endpoint
	Type     RepoType `protobuf:"varint,4,opt,name=type,proto3,enum=redsail.bosn.RepoType" json:"type,omitempty"` // type of repo
	HelmOci  bool     `protobuf:"varint,5,opt,name=helm_oci,json=helmOci,proto3" json:"helm_oci,omitempty"`       // whether or not this is an OCI registry rather than a typical helm registry
	Ready    bool     `protobuf:"varint,6,opt,name=ready,proto3" json:"ready,omitempty"`                          // repo ready status, based on whether index.yaml can be fetched
	// contains filtered or unexported fields
}

func (*RepoRead) Descriptor deprecated

func (*RepoRead) Descriptor() ([]byte, []int)

Deprecated: Use RepoRead.ProtoReflect.Descriptor instead.

func (*RepoRead) GetEndpoint

func (x *RepoRead) GetEndpoint() string

func (*RepoRead) GetHelmOci added in v0.8.2

func (x *RepoRead) GetHelmOci() bool

func (*RepoRead) GetName

func (x *RepoRead) GetName() string

func (*RepoRead) GetReady

func (x *RepoRead) GetReady() bool

func (*RepoRead) GetType added in v0.4.0

func (x *RepoRead) GetType() RepoType

func (*RepoRead) GetUuid

func (x *RepoRead) GetUuid() string

func (*RepoRead) ProtoMessage

func (*RepoRead) ProtoMessage()

func (*RepoRead) ProtoReflect

func (x *RepoRead) ProtoReflect() protoreflect.Message

func (*RepoRead) Reset

func (x *RepoRead) Reset()

func (*RepoRead) String

func (x *RepoRead) String() string

type RepoType added in v0.4.0

type RepoType int32
const (
	RepoType_HELM_REPO RepoType = 0
	RepoType_GIT_REPO  RepoType = 1
)

func (RepoType) Descriptor added in v0.4.0

func (RepoType) Descriptor() protoreflect.EnumDescriptor

func (RepoType) Enum added in v0.4.0

func (x RepoType) Enum() *RepoType

func (RepoType) EnumDescriptor deprecated added in v0.4.0

func (RepoType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RepoType.Descriptor instead.

func (RepoType) Number added in v0.4.0

func (x RepoType) Number() protoreflect.EnumNumber

func (RepoType) String added in v0.4.0

func (x RepoType) String() string

func (RepoType) Type added in v0.4.0

type RepoUpdated

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

func (*RepoUpdated) Descriptor deprecated

func (*RepoUpdated) Descriptor() ([]byte, []int)

Deprecated: Use RepoUpdated.ProtoReflect.Descriptor instead.

func (*RepoUpdated) ProtoMessage

func (*RepoUpdated) ProtoMessage()

func (*RepoUpdated) ProtoReflect

func (x *RepoUpdated) ProtoReflect() protoreflect.Message

func (*RepoUpdated) Reset

func (x *RepoUpdated) Reset()

func (*RepoUpdated) String

func (x *RepoUpdated) String() string

type ReposRead

type ReposRead struct {
	Repos []*RepoRead `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"` // repos read
	// contains filtered or unexported fields
}

func (*ReposRead) Descriptor deprecated

func (*ReposRead) Descriptor() ([]byte, []int)

Deprecated: Use ReposRead.ProtoReflect.Descriptor instead.

func (*ReposRead) GetRepos

func (x *ReposRead) GetRepos() []*RepoRead

func (*ReposRead) ProtoMessage

func (*ReposRead) ProtoMessage()

func (*ReposRead) ProtoReflect

func (x *ReposRead) ProtoReflect() protoreflect.Message

func (*ReposRead) Reset

func (x *ReposRead) Reset()

func (*ReposRead) String

func (x *ReposRead) String() string

type TwirpServer

type TwirpServer interface {
	http.Handler

	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewRepoServer

func NewRepoServer(svc Repo, opts ...interface{}) TwirpServer

NewRepoServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

type UpdateRepo

type UpdateRepo struct {
	Uuid     string   `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`                             // unique id of the repo
	Name     string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                             // name of the repo
	Endpoint string   `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`                     // repo endpoint
	Type     RepoType `protobuf:"varint,4,opt,name=type,proto3,enum=redsail.bosn.RepoType" json:"type,omitempty"` // type of repo
	Token    string   `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`                           // an auth token (if required for this repo)
	Username string   `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"`                     // a username to login with
	Password string   `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"`                     // a password to login with
	HelmOci  bool     `protobuf:"varint,8,opt,name=helm_oci,json=helmOci,proto3" json:"helm_oci,omitempty"`       // whether or not this is an OCI registry rather than a typical helm registry
	// contains filtered or unexported fields
}

func (*UpdateRepo) Descriptor deprecated

func (*UpdateRepo) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRepo.ProtoReflect.Descriptor instead.

func (*UpdateRepo) GetEndpoint

func (x *UpdateRepo) GetEndpoint() string

func (*UpdateRepo) GetHelmOci added in v0.8.2

func (x *UpdateRepo) GetHelmOci() bool

func (*UpdateRepo) GetName

func (x *UpdateRepo) GetName() string

func (*UpdateRepo) GetPassword added in v0.8.2

func (x *UpdateRepo) GetPassword() string

func (*UpdateRepo) GetToken added in v0.5.0

func (x *UpdateRepo) GetToken() string

func (*UpdateRepo) GetType added in v0.4.0

func (x *UpdateRepo) GetType() RepoType

func (*UpdateRepo) GetUsername added in v0.8.2

func (x *UpdateRepo) GetUsername() string

func (*UpdateRepo) GetUuid

func (x *UpdateRepo) GetUuid() string

func (*UpdateRepo) ProtoMessage

func (*UpdateRepo) ProtoMessage()

func (*UpdateRepo) ProtoReflect

func (x *UpdateRepo) ProtoReflect() protoreflect.Message

func (*UpdateRepo) Reset

func (x *UpdateRepo) Reset()

func (*UpdateRepo) String

func (x *UpdateRepo) String() string

Jump to

Keyboard shortcuts

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