Documentation
¶
Index ¶
- Variables
- func ReadJSON(r io.Reader, m *Manifest) error
- func WriteJSON(w io.Writer, m *Manifest) error
- type BuildInfo
- func (*BuildInfo) Descriptor() ([]byte, []int)deprecated
- func (x *BuildInfo) GetImage() string
- func (x *BuildInfo) GetMaintainer() string
- func (x *BuildInfo) GetPath() string
- func (x *BuildInfo) GetTag() string
- func (*BuildInfo) ProtoMessage()
- func (x *BuildInfo) ProtoReflect() protoreflect.Message
- func (x *BuildInfo) Reset()
- func (x *BuildInfo) String() string
- type FoldHTTPMethod
- func (FoldHTTPMethod) Descriptor() protoreflect.EnumDescriptor
- func (x FoldHTTPMethod) Enum() *FoldHTTPMethod
- func (FoldHTTPMethod) EnumDescriptor() ([]byte, []int)deprecated
- func (x FoldHTTPMethod) Number() protoreflect.EnumNumber
- func (x FoldHTTPMethod) String() string
- func (FoldHTTPMethod) Type() protoreflect.EnumType
- type FoldHTTPProto
- func (*FoldHTTPProto) Descriptor() ([]byte, []int)deprecated
- func (x *FoldHTTPProto) GetMajor() int32
- func (x *FoldHTTPProto) GetMinor() int32
- func (x *FoldHTTPProto) GetProto() string
- func (*FoldHTTPProto) ProtoMessage()
- func (x *FoldHTTPProto) ProtoReflect() protoreflect.Message
- func (x *FoldHTTPProto) Reset()
- func (x *FoldHTTPProto) String() string
- type FoldHTTPRequest
- func (*FoldHTTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *FoldHTTPRequest) GetBody() []byte
- func (x *FoldHTTPRequest) GetContentLength() int64
- func (x *FoldHTTPRequest) GetFragment() string
- func (x *FoldHTTPRequest) GetHeaders() map[string]*StringArray
- func (x *FoldHTTPRequest) GetHost() string
- func (x *FoldHTTPRequest) GetHttpMethod() FoldHTTPMethod
- func (x *FoldHTTPRequest) GetHttpProto() *FoldHTTPProto
- func (x *FoldHTTPRequest) GetPath() string
- func (x *FoldHTTPRequest) GetPathParams() map[string]string
- func (x *FoldHTTPRequest) GetQueryParams() map[string]*StringArray
- func (x *FoldHTTPRequest) GetRawQuery() string
- func (x *FoldHTTPRequest) GetRemoteAddr() string
- func (x *FoldHTTPRequest) GetRequestUri() string
- func (x *FoldHTTPRequest) GetRoute() string
- func (*FoldHTTPRequest) ProtoMessage()
- func (x *FoldHTTPRequest) ProtoReflect() protoreflect.Message
- func (x *FoldHTTPRequest) Reset()
- func (x *FoldHTTPRequest) String() string
- type FoldHTTPResponse
- func (*FoldHTTPResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FoldHTTPResponse) GetBody() []byte
- func (x *FoldHTTPResponse) GetHeaders() map[string]*StringArray
- func (x *FoldHTTPResponse) GetStatus() int32
- func (*FoldHTTPResponse) ProtoMessage()
- func (x *FoldHTTPResponse) ProtoReflect() protoreflect.Message
- func (x *FoldHTTPResponse) Reset()
- func (x *FoldHTTPResponse) String() string
- type InvalidHTTPMethod
- type Manifest
- func (*Manifest) Descriptor() ([]byte, []int)deprecated
- func (x *Manifest) GetBuildInfo() *BuildInfo
- func (x *Manifest) GetName() string
- func (x *Manifest) GetRoutes() []*Route
- func (x *Manifest) GetVersion() *Version
- func (*Manifest) ProtoMessage()
- func (x *Manifest) ProtoReflect() protoreflect.Message
- func (x *Manifest) Reset()
- func (x *Manifest) String() string
- type Route
- type StringArray
- type Version
- func (*Version) Descriptor() ([]byte, []int)deprecated
- func (x *Version) GetMajor() int32
- func (x *Version) GetMinor() int32
- func (x *Version) GetPatch() int32
- func (*Version) ProtoMessage()
- func (x *Version) ProtoReflect() protoreflect.Message
- func (x *Version) Reset()
- func (x *Version) String() string
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_http_proto protoreflect.FileDescriptor
View Source
var File_manifest_proto protoreflect.FileDescriptor
Functions ¶
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) GetMaintainer ¶
func (*BuildInfo) ProtoMessage ¶
func (*BuildInfo) ProtoMessage()
func (*BuildInfo) ProtoReflect ¶
func (x *BuildInfo) ProtoReflect() protoreflect.Message
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) Descriptor() protoreflect.EnumDescriptor
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 (x FoldHTTPMethod) Number() protoreflect.EnumNumber
func (FoldHTTPMethod) String ¶ added in v0.1.2
func (x FoldHTTPMethod) String() string
func (FoldHTTPMethod) Type ¶ added in v0.1.2
func (FoldHTTPMethod) Type() protoreflect.EnumType
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) GetBuildInfo ¶
func (*Manifest) GetVersion ¶
func (*Manifest) ProtoMessage ¶
func (*Manifest) ProtoMessage()
func (*Manifest) ProtoReflect ¶
func (x *Manifest) ProtoReflect() protoreflect.Message
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) GetHttpMethod ¶
func (x *Route) GetHttpMethod() FoldHTTPMethod
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) ProtoReflect ¶
func (x *Route) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) ProtoReflect ¶
func (x *Version) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.