manifest

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FoldHTTPMethod_name = map[int32]string{
		0: "GET",
		1: "HEAD",
		2: "POST",
		3: "PUT",
		4: "DELETE",
		5: "CONNECT",
		6: "OPTIONS",
		7: "TRACE",
		8: "PATCH",
	}
	FoldHTTPMethod_value = map[string]int32{
		"GET":     0,
		"HEAD":    1,
		"POST":    2,
		"PUT":     3,
		"DELETE":  4,
		"CONNECT": 5,
		"OPTIONS": 6,
		"TRACE":   7,
		"PATCH":   8,
	}
)

Enum value maps for FoldHTTPMethod.

View Source
var (
	FailedToWriteJSON = errors.New("failed to convert manifest to JSON")
	FailedToReadJSON  = errors.New("failed to read manifest from JSON")
)
View Source
var File_manifest_proto protoreflect.FileDescriptor

Functions

func ReadJSON added in v0.1.2

func ReadJSON(r io.Reader, m *Manifest) error

func WriteJSON added in v0.1.2

func WriteJSON(w io.Writer, m *Manifest) error

Types

type BuildInfo

type BuildInfo struct {

	// The maintainer of the service.
	Maintainer string `protobuf:"bytes,1,opt,name=maintainer,proto3" json:"maintainer,omitempty"`
	// The image name.
	Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
	// The image tag.
	Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	// The path to the service, relative to the project root.
	Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*BuildInfo) Descriptor deprecated

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

Deprecated: Use BuildInfo.ProtoReflect.Descriptor instead.

func (*BuildInfo) GetImage

func (x *BuildInfo) GetImage() string

func (*BuildInfo) GetMaintainer

func (x *BuildInfo) GetMaintainer() string

func (*BuildInfo) GetPath

func (x *BuildInfo) GetPath() string

func (*BuildInfo) GetTag

func (x *BuildInfo) GetTag() string

func (*BuildInfo) ProtoMessage

func (*BuildInfo) ProtoMessage()

func (*BuildInfo) ProtoReflect

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

func (*BuildInfo) Reset

func (x *BuildInfo) Reset()

func (*BuildInfo) String

func (x *BuildInfo) String() string

type FoldHTTPMethod added in v0.1.2

type FoldHTTPMethod int32

All HTTP Methods

const (
	FoldHTTPMethod_GET     FoldHTTPMethod = 0
	FoldHTTPMethod_HEAD    FoldHTTPMethod = 1
	FoldHTTPMethod_POST    FoldHTTPMethod = 2
	FoldHTTPMethod_PUT     FoldHTTPMethod = 3
	FoldHTTPMethod_DELETE  FoldHTTPMethod = 4
	FoldHTTPMethod_CONNECT FoldHTTPMethod = 5
	FoldHTTPMethod_OPTIONS FoldHTTPMethod = 6
	FoldHTTPMethod_TRACE   FoldHTTPMethod = 7
	FoldHTTPMethod_PATCH   FoldHTTPMethod = 8
)

func HTTPMethodFromString added in v0.1.2

func HTTPMethodFromString(method string) (FoldHTTPMethod, error)

func (FoldHTTPMethod) Descriptor added in v0.1.2

func (FoldHTTPMethod) Enum added in v0.1.2

func (x FoldHTTPMethod) Enum() *FoldHTTPMethod

func (FoldHTTPMethod) EnumDescriptor deprecated added in v0.1.2

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

Deprecated: Use FoldHTTPMethod.Descriptor instead.

func (FoldHTTPMethod) Number added in v0.1.2

func (FoldHTTPMethod) String added in v0.1.2

func (x FoldHTTPMethod) String() string

func (FoldHTTPMethod) Type added in v0.1.2

type FoldHTTPProto added in v0.1.2

type FoldHTTPProto struct {

	// The full string name of the protocol, e.g. HTTP/2.0
	Proto string `protobuf:"bytes,1,opt,name=proto,proto3" json:"proto,omitempty"`
	// The major version of the HTTP protocol, e.g. 2
	Major int32 `protobuf:"varint,2,opt,name=major,proto3" json:"major,omitempty"`
	// The minor version of the hTTP protocol, e.g. 2
	Minor int32 `protobuf:"varint,3,opt,name=minor,proto3" json:"minor,omitempty"`
	// contains filtered or unexported fields
}

func (*FoldHTTPProto) Descriptor deprecated added in v0.1.2

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

Deprecated: Use FoldHTTPProto.ProtoReflect.Descriptor instead.

func (*FoldHTTPProto) GetMajor added in v0.1.2

func (x *FoldHTTPProto) GetMajor() int32

func (*FoldHTTPProto) GetMinor added in v0.1.2

func (x *FoldHTTPProto) GetMinor() int32

func (*FoldHTTPProto) GetProto added in v0.1.2

func (x *FoldHTTPProto) GetProto() string

func (*FoldHTTPProto) ProtoMessage added in v0.1.2

func (*FoldHTTPProto) ProtoMessage()

func (*FoldHTTPProto) ProtoReflect added in v0.1.2

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

func (*FoldHTTPProto) Reset added in v0.1.2

func (x *FoldHTTPProto) Reset()

func (*FoldHTTPProto) String added in v0.1.2

func (x *FoldHTTPProto) String() string

type FoldHTTPRequest added in v0.1.2

type FoldHTTPRequest struct {

	// The HTTP Method for the request.
	HttpMethod FoldHTTPMethod `protobuf:"varint,1,opt,name=http_method,json=httpMethod,proto3,enum=http.FoldHTTPMethod" json:"http_method,omitempty"`
	// The full URL of the HTTP request.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// The raw query from the request line, without the '?'
	RawQuery string `protobuf:"bytes,3,opt,name=raw_query,json=rawQuery,proto3" json:"raw_query,omitempty"`
	// The raw fragment from the request line, if any
	Fragment string `protobuf:"bytes,4,opt,name=fragment,proto3" json:"fragment,omitempty"`
	// The version of the HTTP Protocol being used.
	HttpProto *FoldHTTPProto `protobuf:"bytes,5,opt,name=http_proto,json=httpProto,proto3" json:"http_proto,omitempty"`
	// The value of the Host header, which provides the host and port
	// information from the target URI.
	// https://tools.ietf.org/html/rfc7230#section-5.4
	Host string `protobuf:"bytes,6,opt,name=host,proto3" json:"host,omitempty"`
	// The network address of the request sender.
	RemoteAddr string `protobuf:"bytes,7,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"`
	// The request_uri is the unmodified request-target of the
	// Request-Line as sent by the client to the server.
	// https://tools.ietf.org/html/rfc7230#section-3.1.1
	RequestUri string `protobuf:"bytes,8,opt,name=request_uri,json=requestUri,proto3" json:"request_uri,omitempty"`
	// The length, in bytes, of the body.
	ContentLength int64 `protobuf:"varint,9,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
	// The body of the HTTP request. This will often be a JSON string
	// but could be anything if the appropriate content type is set
	// in the headers.
	Body []byte `protobuf:"bytes,10,opt,name=body,proto3" json:"body,omitempty"`
	// The HTTP headers.
	Headers map[string]*StringArray `` /* 156-byte string literal not displayed */
	// The parsed path params.
	PathParams map[string]string `` /* 180-byte string literal not displayed */
	// The parsed query params.
	QueryParams map[string]*StringArray `` /* 183-byte string literal not displayed */
	// The path specification matched by the router.
	// This is for internal use by fold only.
	Route string `protobuf:"bytes,14,opt,name=route,proto3" json:"route,omitempty"`
	// contains filtered or unexported fields
}

func (*FoldHTTPRequest) Descriptor deprecated added in v0.1.2

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

Deprecated: Use FoldHTTPRequest.ProtoReflect.Descriptor instead.

func (*FoldHTTPRequest) GetBody added in v0.1.2

func (x *FoldHTTPRequest) GetBody() []byte

func (*FoldHTTPRequest) GetContentLength added in v0.1.2

func (x *FoldHTTPRequest) GetContentLength() int64

func (*FoldHTTPRequest) GetFragment added in v0.1.2

func (x *FoldHTTPRequest) GetFragment() string

func (*FoldHTTPRequest) GetHeaders added in v0.1.2

func (x *FoldHTTPRequest) GetHeaders() map[string]*StringArray

func (*FoldHTTPRequest) GetHost added in v0.1.2

func (x *FoldHTTPRequest) GetHost() string

func (*FoldHTTPRequest) GetHttpMethod added in v0.1.2

func (x *FoldHTTPRequest) GetHttpMethod() FoldHTTPMethod

func (*FoldHTTPRequest) GetHttpProto added in v0.1.2

func (x *FoldHTTPRequest) GetHttpProto() *FoldHTTPProto

func (*FoldHTTPRequest) GetPath added in v0.1.2

func (x *FoldHTTPRequest) GetPath() string

func (*FoldHTTPRequest) GetPathParams added in v0.1.2

func (x *FoldHTTPRequest) GetPathParams() map[string]string

func (*FoldHTTPRequest) GetQueryParams added in v0.1.2

func (x *FoldHTTPRequest) GetQueryParams() map[string]*StringArray

func (*FoldHTTPRequest) GetRawQuery added in v0.1.2

func (x *FoldHTTPRequest) GetRawQuery() string

func (*FoldHTTPRequest) GetRemoteAddr added in v0.1.2

func (x *FoldHTTPRequest) GetRemoteAddr() string

func (*FoldHTTPRequest) GetRequestUri added in v0.1.2

func (x *FoldHTTPRequest) GetRequestUri() string

func (*FoldHTTPRequest) GetRoute added in v0.1.2

func (x *FoldHTTPRequest) GetRoute() string

func (*FoldHTTPRequest) ProtoMessage added in v0.1.2

func (*FoldHTTPRequest) ProtoMessage()

func (*FoldHTTPRequest) ProtoReflect added in v0.1.2

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

func (*FoldHTTPRequest) Reset added in v0.1.2

func (x *FoldHTTPRequest) Reset()

func (*FoldHTTPRequest) String added in v0.1.2

func (x *FoldHTTPRequest) String() string

type FoldHTTPResponse added in v0.1.2

type FoldHTTPResponse struct {

	// The HTTP status code for the response.
	Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	// The body of the HTTP response. As with the Request, it will
	// most often be a JSON string but the headers say what it really is.
	Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// The HTTP headers for the response.
	Headers map[string]*StringArray `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*FoldHTTPResponse) Descriptor deprecated added in v0.1.2

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

Deprecated: Use FoldHTTPResponse.ProtoReflect.Descriptor instead.

func (*FoldHTTPResponse) GetBody added in v0.1.2

func (x *FoldHTTPResponse) GetBody() []byte

func (*FoldHTTPResponse) GetHeaders added in v0.1.2

func (x *FoldHTTPResponse) GetHeaders() map[string]*StringArray

func (*FoldHTTPResponse) GetStatus added in v0.1.2

func (x *FoldHTTPResponse) GetStatus() int32

func (*FoldHTTPResponse) ProtoMessage added in v0.1.2

func (*FoldHTTPResponse) ProtoMessage()

func (*FoldHTTPResponse) ProtoReflect added in v0.1.2

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

func (*FoldHTTPResponse) Reset added in v0.1.2

func (x *FoldHTTPResponse) Reset()

func (*FoldHTTPResponse) String added in v0.1.2

func (x *FoldHTTPResponse) String() string

type InvalidHTTPMethod added in v0.1.2

type InvalidHTTPMethod struct {
	HTTPMethod string
}

func (InvalidHTTPMethod) Error added in v0.1.2

func (ihm InvalidHTTPMethod) Error() string

type Manifest

type Manifest struct {

	// The name of the service.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The version of the service.
	Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// Information required to build the service. This will be filled in
	// by the command line tool.
	BuildInfo *BuildInfo `protobuf:"bytes,3,opt,name=build_info,json=buildInfo,proto3" json:"build_info,omitempty"`
	// The routes defined by the router within the service.
	Routes []*Route `protobuf:"bytes,4,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

A manifest describing everything required to build and deploy a service.

func (*Manifest) Descriptor deprecated

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

Deprecated: Use Manifest.ProtoReflect.Descriptor instead.

func (*Manifest) GetBuildInfo

func (x *Manifest) GetBuildInfo() *BuildInfo

func (*Manifest) GetName

func (x *Manifest) GetName() string

func (*Manifest) GetRoutes

func (x *Manifest) GetRoutes() []*Route

func (*Manifest) GetVersion

func (x *Manifest) GetVersion() *Version

func (*Manifest) ProtoMessage

func (*Manifest) ProtoMessage()

func (*Manifest) ProtoReflect

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

func (*Manifest) Reset

func (x *Manifest) Reset()

func (*Manifest) String

func (x *Manifest) String() string

type Route

type Route struct {

	// The HTTP method which this Route handles.
	HttpMethod FoldHTTPMethod `protobuf:"varint,1,opt,name=http_method,json=httpMethod,proto3,enum=http.FoldHTTPMethod" json:"http_method,omitempty"`
	// The route specification.
	Route string `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"`
	// contains filtered or unexported fields
}

A route defined by a service.

func (*Route) Descriptor deprecated

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

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetHttpMethod

func (x *Route) GetHttpMethod() FoldHTTPMethod

func (*Route) GetRoute added in v0.1.2

func (x *Route) GetRoute() string

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect

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

func (*Route) Reset

func (x *Route) Reset()

func (*Route) String

func (x *Route) String() string

type StringArray added in v0.1.2

type StringArray struct {
	Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*StringArray) Descriptor deprecated added in v0.1.2

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

Deprecated: Use StringArray.ProtoReflect.Descriptor instead.

func (*StringArray) GetValues added in v0.1.2

func (x *StringArray) GetValues() []string

func (*StringArray) ProtoMessage added in v0.1.2

func (*StringArray) ProtoMessage()

func (*StringArray) ProtoReflect added in v0.1.2

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

func (*StringArray) Reset added in v0.1.2

func (x *StringArray) Reset()

func (*StringArray) String added in v0.1.2

func (x *StringArray) String() string

type Version

type Version struct {

	// Major
	Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
	// Minor
	Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
	// Patch
	Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
	// contains filtered or unexported fields
}

A SemVer version number.

func (*Version) Descriptor deprecated

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

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetMajor

func (x *Version) GetMajor() int32

func (*Version) GetMinor

func (x *Version) GetMinor() int32

func (*Version) GetPatch

func (x *Version) GetPatch() int32

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

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

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

Jump to

Keyboard shortcuts

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