gharesults

package
v0.137.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheService_CreateCacheEntry_FullMethodName         = "/github.actions.results.api.v1.CacheService/CreateCacheEntry"
	CacheService_FinalizeCacheEntryUpload_FullMethodName = "/github.actions.results.api.v1.CacheService/FinalizeCacheEntryUpload"
	CacheService_GetCacheEntryDownloadURL_FullMethodName = "/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL"
)
View Source
const CacheServicePathPrefix = "/twirp/github.actions.results.api.v1.CacheService/"

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

Variables

View Source
var CacheService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.actions.results.api.v1.CacheService",
	HandlerType: (*CacheServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateCacheEntry",
			Handler:    _CacheService_CreateCacheEntry_Handler,
		},
		{
			MethodName: "FinalizeCacheEntryUpload",
			Handler:    _CacheService_FinalizeCacheEntryUpload_Handler,
		},
		{
			MethodName: "GetCacheEntryDownloadURL",
			Handler:    _CacheService_GetCacheEntryDownloadURL_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/gharesults/gharesults.proto",
}

CacheService_ServiceDesc is the grpc.ServiceDesc for CacheService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_gharesults_gharesults_proto protoreflect.FileDescriptor

Functions

func RegisterCacheServiceServer

func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer)

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 CacheMetadata

type CacheMetadata struct {
	RepositoryId string        `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"`
	Scope        []*CacheScope `protobuf:"bytes,2,rep,name=scope,proto3" json:"scope,omitempty"`
	// contains filtered or unexported fields
}

func (*CacheMetadata) Descriptor deprecated

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

Deprecated: Use CacheMetadata.ProtoReflect.Descriptor instead.

func (*CacheMetadata) GetRepositoryId

func (x *CacheMetadata) GetRepositoryId() string

func (*CacheMetadata) GetScope

func (x *CacheMetadata) GetScope() []*CacheScope

func (*CacheMetadata) ProtoMessage

func (*CacheMetadata) ProtoMessage()

func (*CacheMetadata) ProtoReflect

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

func (*CacheMetadata) Reset

func (x *CacheMetadata) Reset()

func (*CacheMetadata) String

func (x *CacheMetadata) String() string

type CacheScope

type CacheScope struct {
	Scope      string `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"`
	Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
	// contains filtered or unexported fields
}

func (*CacheScope) Descriptor deprecated

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

Deprecated: Use CacheScope.ProtoReflect.Descriptor instead.

func (*CacheScope) GetPermission

func (x *CacheScope) GetPermission() string

func (*CacheScope) GetScope

func (x *CacheScope) GetScope() string

func (*CacheScope) ProtoMessage

func (*CacheScope) ProtoMessage()

func (*CacheScope) ProtoReflect

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

func (*CacheScope) Reset

func (x *CacheScope) Reset()

func (*CacheScope) String

func (x *CacheScope) String() string

type CacheService

func NewCacheServiceJSONClient

func NewCacheServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CacheService

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

func NewCacheServiceProtobufClient

func NewCacheServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CacheService

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

type CacheServiceClient

type CacheServiceClient interface {
	CreateCacheEntry(ctx context.Context, in *CreateCacheEntryRequest, opts ...grpc.CallOption) (*CreateCacheEntryResponse, error)
	FinalizeCacheEntryUpload(ctx context.Context, in *FinalizeCacheEntryUploadRequest, opts ...grpc.CallOption) (*FinalizeCacheEntryUploadResponse, error)
	GetCacheEntryDownloadURL(ctx context.Context, in *GetCacheEntryDownloadURLRequest, opts ...grpc.CallOption) (*GetCacheEntryDownloadURLResponse, error)
}

CacheServiceClient is the client API for CacheService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type CacheServiceServer

type CacheServiceServer interface {
	CreateCacheEntry(context.Context, *CreateCacheEntryRequest) (*CreateCacheEntryResponse, error)
	FinalizeCacheEntryUpload(context.Context, *FinalizeCacheEntryUploadRequest) (*FinalizeCacheEntryUploadResponse, error)
	GetCacheEntryDownloadURL(context.Context, *GetCacheEntryDownloadURLRequest) (*GetCacheEntryDownloadURLResponse, error)
	// contains filtered or unexported methods
}

CacheServiceServer is the server API for CacheService service. All implementations must embed UnimplementedCacheServiceServer for forward compatibility.

type CreateCacheEntryRequest

type CreateCacheEntryRequest struct {
	Metadata *CacheMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Key      string         `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Version  string         `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCacheEntryRequest) Descriptor deprecated

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

Deprecated: Use CreateCacheEntryRequest.ProtoReflect.Descriptor instead.

func (*CreateCacheEntryRequest) GetKey

func (x *CreateCacheEntryRequest) GetKey() string

func (*CreateCacheEntryRequest) GetMetadata

func (x *CreateCacheEntryRequest) GetMetadata() *CacheMetadata

func (*CreateCacheEntryRequest) GetVersion

func (x *CreateCacheEntryRequest) GetVersion() string

func (*CreateCacheEntryRequest) ProtoMessage

func (*CreateCacheEntryRequest) ProtoMessage()

func (*CreateCacheEntryRequest) ProtoReflect

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

func (*CreateCacheEntryRequest) Reset

func (x *CreateCacheEntryRequest) Reset()

func (*CreateCacheEntryRequest) String

func (x *CreateCacheEntryRequest) String() string

type CreateCacheEntryResponse

type CreateCacheEntryResponse struct {
	Ok              bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	SignedUploadUrl string `protobuf:"bytes,2,opt,name=signed_upload_url,json=signedUploadUrl,proto3" json:"signed_upload_url,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCacheEntryResponse) Descriptor deprecated

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

Deprecated: Use CreateCacheEntryResponse.ProtoReflect.Descriptor instead.

func (*CreateCacheEntryResponse) GetOk

func (x *CreateCacheEntryResponse) GetOk() bool

func (*CreateCacheEntryResponse) GetSignedUploadUrl

func (x *CreateCacheEntryResponse) GetSignedUploadUrl() string

func (*CreateCacheEntryResponse) ProtoMessage

func (*CreateCacheEntryResponse) ProtoMessage()

func (*CreateCacheEntryResponse) ProtoReflect

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

func (*CreateCacheEntryResponse) Reset

func (x *CreateCacheEntryResponse) Reset()

func (*CreateCacheEntryResponse) String

func (x *CreateCacheEntryResponse) String() string

type FinalizeCacheEntryUploadRequest

type FinalizeCacheEntryUploadRequest struct {
	Metadata  *CacheMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Key       string         `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	SizeBytes int64          `protobuf:"varint,3,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	Version   string         `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*FinalizeCacheEntryUploadRequest) Descriptor deprecated

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

Deprecated: Use FinalizeCacheEntryUploadRequest.ProtoReflect.Descriptor instead.

func (*FinalizeCacheEntryUploadRequest) GetKey

func (*FinalizeCacheEntryUploadRequest) GetMetadata

func (*FinalizeCacheEntryUploadRequest) GetSizeBytes

func (x *FinalizeCacheEntryUploadRequest) GetSizeBytes() int64

func (*FinalizeCacheEntryUploadRequest) GetVersion

func (x *FinalizeCacheEntryUploadRequest) GetVersion() string

func (*FinalizeCacheEntryUploadRequest) ProtoMessage

func (*FinalizeCacheEntryUploadRequest) ProtoMessage()

func (*FinalizeCacheEntryUploadRequest) ProtoReflect

func (*FinalizeCacheEntryUploadRequest) Reset

func (*FinalizeCacheEntryUploadRequest) String

type FinalizeCacheEntryUploadResponse

type FinalizeCacheEntryUploadResponse struct {
	Ok      bool  `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	EntryId int64 `protobuf:"varint,2,opt,name=entry_id,json=entryId,proto3" json:"entry_id,omitempty"`
	// contains filtered or unexported fields
}

func (*FinalizeCacheEntryUploadResponse) Descriptor deprecated

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

Deprecated: Use FinalizeCacheEntryUploadResponse.ProtoReflect.Descriptor instead.

func (*FinalizeCacheEntryUploadResponse) GetEntryId

func (x *FinalizeCacheEntryUploadResponse) GetEntryId() int64

func (*FinalizeCacheEntryUploadResponse) GetOk

func (*FinalizeCacheEntryUploadResponse) ProtoMessage

func (*FinalizeCacheEntryUploadResponse) ProtoMessage()

func (*FinalizeCacheEntryUploadResponse) ProtoReflect

func (*FinalizeCacheEntryUploadResponse) Reset

func (*FinalizeCacheEntryUploadResponse) String

type GetCacheEntryDownloadURLRequest

type GetCacheEntryDownloadURLRequest struct {
	Metadata    *CacheMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Key         string         `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	RestoreKeys []string       `protobuf:"bytes,3,rep,name=restore_keys,json=restoreKeys,proto3" json:"restore_keys,omitempty"`
	Version     string         `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*GetCacheEntryDownloadURLRequest) Descriptor deprecated

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

Deprecated: Use GetCacheEntryDownloadURLRequest.ProtoReflect.Descriptor instead.

func (*GetCacheEntryDownloadURLRequest) GetKey

func (*GetCacheEntryDownloadURLRequest) GetMetadata

func (*GetCacheEntryDownloadURLRequest) GetRestoreKeys

func (x *GetCacheEntryDownloadURLRequest) GetRestoreKeys() []string

func (*GetCacheEntryDownloadURLRequest) GetVersion

func (x *GetCacheEntryDownloadURLRequest) GetVersion() string

func (*GetCacheEntryDownloadURLRequest) ProtoMessage

func (*GetCacheEntryDownloadURLRequest) ProtoMessage()

func (*GetCacheEntryDownloadURLRequest) ProtoReflect

func (*GetCacheEntryDownloadURLRequest) Reset

func (*GetCacheEntryDownloadURLRequest) String

type GetCacheEntryDownloadURLResponse

type GetCacheEntryDownloadURLResponse struct {
	Ok                bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	SignedDownloadUrl string `protobuf:"bytes,2,opt,name=signed_download_url,json=signedDownloadUrl,proto3" json:"signed_download_url,omitempty"`
	MatchedKey        string `protobuf:"bytes,3,opt,name=matched_key,json=matchedKey,proto3" json:"matched_key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetCacheEntryDownloadURLResponse) Descriptor deprecated

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

Deprecated: Use GetCacheEntryDownloadURLResponse.ProtoReflect.Descriptor instead.

func (*GetCacheEntryDownloadURLResponse) GetMatchedKey

func (x *GetCacheEntryDownloadURLResponse) GetMatchedKey() string

func (*GetCacheEntryDownloadURLResponse) GetOk

func (*GetCacheEntryDownloadURLResponse) GetSignedDownloadUrl

func (x *GetCacheEntryDownloadURLResponse) GetSignedDownloadUrl() string

func (*GetCacheEntryDownloadURLResponse) ProtoMessage

func (*GetCacheEntryDownloadURLResponse) ProtoMessage()

func (*GetCacheEntryDownloadURLResponse) ProtoReflect

func (*GetCacheEntryDownloadURLResponse) Reset

func (*GetCacheEntryDownloadURLResponse) 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 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
	// google.golang.org/protobuf/types/descriptorpb.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 NewCacheServiceServer

func NewCacheServiceServer(svc CacheService, opts ...interface{}) TwirpServer

NewCacheServiceServer 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 UnimplementedCacheServiceServer

type UnimplementedCacheServiceServer struct{}

UnimplementedCacheServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedCacheServiceServer) CreateCacheEntry

type UnsafeCacheServiceServer

type UnsafeCacheServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCacheServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CacheServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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