Skip to content

Commit

Permalink
client enhance
Browse files Browse the repository at this point in the history
  • Loading branch information
olegdayo committed Jun 29, 2023
1 parent a4d27b2 commit fb029e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ func (c *Client) CanProceed(to endpoint.Endpoint) bool {
return c.IsRelationPresent(c.current, to)
}

func (c *Client) SendRequest(to endpoint.Endpoint, method endpoint.Endpoint) error {
func (c *Client) SendRequest(to endpoint.Endpoint, request server.Request) error {
if !c.CanProceed(to) {
return fmt.Errorf("cannot get from %s to %s", c.current, to)
}

log.Printf("Proceed from %s to %s", c.current, to)
c.current = to

// TODO: send request
switch to.Method {
case endpoint.GET:
case endpoint.POST:
case endpoint.PUT:
case endpoint.PATCH:
case endpoint.DELETE:
}

return nil
}

0 comments on commit fb029e4

Please sign in to comment.