autogen some http functions
This commit is contained in:
parent
18796d1a47
commit
556c549265
|
@ -13,11 +13,12 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p *Patches) HttpPostVerbose(baseURL string, route string) (*Patches, error) {
|
func (p *Patches) HttpPostVerbose(baseURL string, route string) (*Patches, *httppb.HttpRequest, error) {
|
||||||
p.PrintTable()
|
p.PrintTable()
|
||||||
return p.HttpPost(baseURL, route)
|
return p.HttpPost(baseURL, route)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (p *Patches) HttpPost(baseURL string, route string) (*Patches, error) {
|
func (p *Patches) HttpPost(baseURL string, route string) (*Patches, error) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
log.Info("can't post a nil PB")
|
log.Info("can't post a nil PB")
|
||||||
|
@ -60,6 +61,7 @@ func (p *Patches) HttpPost(baseURL string, route string) (*Patches, error) {
|
||||||
}
|
}
|
||||||
return newpb, err
|
return newpb, err
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (p *Patchset) HttpPost(baseURL string, route string) (*Patchset, error) {
|
func (p *Patchset) HttpPost(baseURL string, route string) (*Patchset, error) {
|
||||||
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
|
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
|
||||||
|
@ -93,6 +95,7 @@ func (p *Patchset) HttpPost(baseURL string, route string) (*Patchset, error) {
|
||||||
return newpb, err
|
return newpb, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (p *Patches) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest) error {
|
func (p *Patches) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest) error {
|
||||||
data, err := p.Marshal()
|
data, err := p.Marshal()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -126,12 +129,14 @@ func (p *Patchsets) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (p *Patchsets) HttpPostVerbose(baseURL string, route string) (*Patchsets, error) {
|
func (p *Patchsets) HttpPostVerbose(baseURL string, route string) (*Patchsets, *httppb.HttpRequest, error) {
|
||||||
p.PrintTable()
|
p.PrintTable()
|
||||||
return p.HttpPost(baseURL, route)
|
return p.HttpPost(baseURL, route)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (p *Patchsets) HttpPost(baseURL string, route string) (*Patchsets, error) {
|
func (p *Patchsets) HttpPost(baseURL string, route string) (*Patchsets, error) {
|
||||||
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
|
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
|
||||||
// Even though the linux kernel gets the network payload
|
// Even though the linux kernel gets the network payload
|
||||||
|
@ -163,3 +168,4 @@ func (p *Patchsets) HttpPost(baseURL string, route string) (*Patchsets, error) {
|
||||||
log.Infof("patchset PB HttpPost %s sent len(%d) got len(%d)\n", finalURL.String(), p.Len(), newpb.Len())
|
log.Infof("patchset PB HttpPost %s sent len(%d) got len(%d)\n", finalURL.String(), p.Len(), newpb.Len())
|
||||||
return newpb, err
|
return newpb, err
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -59,7 +59,7 @@ message Patch {
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is a "PATCH: [1/x]" series
|
// this is a "PATCH: [1/x]" series
|
||||||
message Patches { // `autogenpb:marshal` `autogenpb:gui:Patch`
|
message Patches { // `autogenpb:marshal` `autogenpb:gui:Patch` `autogenpb:http`
|
||||||
string uuid = 1; // `autogenpb:uuid:2679065e-c81d-4a00-aca4-03c158a834fb`
|
string uuid = 1; // `autogenpb:uuid:2679065e-c81d-4a00-aca4-03c158a834fb`
|
||||||
string version = 2; // `autogenpb:version:v2.0.0`
|
string version = 2; // `autogenpb:version:v2.0.0`
|
||||||
repeated Patch Patches = 3;
|
repeated Patch Patches = 3;
|
||||||
|
@ -82,7 +82,7 @@ message Patchset { // `autogenpb:mars
|
||||||
string hostname = 14; //
|
string hostname = 14; //
|
||||||
}
|
}
|
||||||
|
|
||||||
message Patchsets { // `autogenpb:marshal` `autogenpb:gui` `autogenpb:nomutex`
|
message Patchsets { // `autogenpb:marshal` `autogenpb:gui` `autogenpb:nomutex` `autogenpb:http`
|
||||||
string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079`
|
string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079`
|
||||||
string version = 2; // `autogenpb:version:v0.0.45`
|
string version = 2; // `autogenpb:version:v0.0.45`
|
||||||
repeated Patchset Patchsets = 3;
|
repeated Patchset Patchsets = 3;
|
||||||
|
|
Loading…
Reference in New Issue