@@ -86,13 +86,13 @@ func (c *Client) FetchExecutionJobLog(executionID int64, jobID string, offset in
8686 return log , err
8787}
8888
89- func (c * Client ) FlowExecutions (project , flow string ) (Executions , error ) {
89+ func (c * Client ) FlowExecutions (project , flow string , paginator Paginator ) (Executions , error ) {
9090 params := make (map [string ]string )
9191 params ["ajax" ] = "fetchFlowExecutions"
9292 params ["project" ] = project
9393 params ["flow" ] = flow
94- params ["start" ] = "0"
95- params ["length" ] = "20"
94+ params ["start" ] = strconv . Itoa ( paginator . Offset )
95+ params ["length" ] = strconv . Itoa ( paginator . Length )
9696
9797 executions := ExecutionsList {}
9898 if err := c .requestAndDecode ("GET" , "manager" , params , & executions ); err != nil {
@@ -257,15 +257,6 @@ func findExecutions(n *htmlx.Node) ([]FlowExecution, error) {
257257 return executions , nil
258258}
259259
260- func getAttribute (n * htmlx.Node , name string ) string {
261- for _ , a := range n .Attr {
262- if a .Key == name {
263- return a .Val
264- }
265- }
266- return ""
267- }
268-
269260func findElementsOfType (n * htmlx.Node , t string ) []* htmlx.Node {
270261 var result []* htmlx.Node
271262 if n .Type == htmlx .ElementNode && n .Data == t {
@@ -281,7 +272,7 @@ func findElementsOfType(n *htmlx.Node, t string) []*htmlx.Node {
281272
282273func findElementWithID (n * htmlx.Node , id string ) * htmlx.Node {
283274 if hasAttribute (n , "id" , id ) {
284- return n ;
275+ return n
285276 }
286277 for c := n .FirstChild ; c != nil ; c = c .NextSibling {
287278 if result := findElementWithID (c , id ); result != nil {
0 commit comments