Browse Source

Move Golang API client here

Frédéric Guillot 10 months ago
parent
commit
f43a055d63

+ 1
- 7
Gopkg.lock View File

@@ -41,12 +41,6 @@
41 41
   ]
42 42
   revision = "90697d60dd844d5ef6ff15135d0203f65d2f53b8"
43 43
 
44
-[[projects]]
45
-  branch = "master"
46
-  name = "github.com/miniflux/miniflux-go"
47
-  packages = ["."]
48
-  revision = "7b8d54a221db7b3e049f63e302ebbcc7d6a8d6be"
49
-
50 44
 [[projects]]
51 45
   name = "github.com/tdewolff/minify"
52 46
   packages = [
@@ -152,6 +146,6 @@
152 146
 [solve-meta]
153 147
   analyzer-name = "dep"
154 148
   analyzer-version = 1
155
-  inputs-digest = "62141ee1c8cb97033a8a89a45761f074ff9632cb57fe9e4440493ddfce0b083c"
149
+  inputs-digest = "bcdb45e8fd281e2a0b71ac72bfeba98a126cdbc8809da17e7e63394237105e32"
156 150
   solver-name = "gps-cdcl"
157 151
   solver-version = 1

+ 1
- 5
Gopkg.toml View File

@@ -21,7 +21,7 @@
21 21
 #  version = "2.4.0"
22 22
 
23 23
 [metadata.heroku]
24
-  root-package = "github.com/miniflux/miniflux"
24
+  root-package = "miniflux.app"
25 25
   go-version = "go1.10"
26 26
   ensure = "false"
27 27
 
@@ -37,10 +37,6 @@
37 37
   branch = "master"
38 38
   name = "github.com/lib/pq"
39 39
 
40
-[[constraint]]
41
-  branch = "master"
42
-  name = "github.com/miniflux/miniflux-go"
43
-
44 40
 [[constraint]]
45 41
   name = "github.com/tdewolff/minify"
46 42
   version = "2.3.5"

+ 50
- 0
client/README.md View File

@@ -0,0 +1,50 @@
1
+Miniflux API Client
2
+===================
3
+
4
+Client library for Miniflux REST API.
5
+
6
+Installation
7
+------------
8
+
9
+```bash
10
+go get -u miniflux.app/client
11
+```
12
+
13
+Example
14
+-------
15
+
16
+```go
17
+package main
18
+
19
+import (
20
+	"fmt"
21
+    "io/ioutil"
22
+
23
+	miniflux "miniflux.app/client"
24
+)
25
+
26
+func main() {
27
+    client := miniflux.New("https://api.example.org", "admin", "secret")
28
+
29
+    // Fetch all feeds.
30
+    feeds, err := client.Feeds()
31
+    if err != nil {
32
+        fmt.Println(err)
33
+        return
34
+    }
35
+    fmt.Println(feeds)
36
+
37
+    // Backup your feeds to an OPML file.
38
+    opml, err := client.Export()
39
+    if err != nil {
40
+        fmt.Println(err)
41
+        return
42
+    }
43
+
44
+    err = ioutil.WriteFile("opml.xml", opml, 0644)
45
+    if err != nil {
46
+        fmt.Println(err)
47
+        return
48
+    }
49
+}
50
+```

vendor/github.com/miniflux/miniflux-go/client.go → client/client.go View File

@@ -1,8 +1,8 @@
1
-// Copyright 2017 Frédéric Guillot. All rights reserved.
1
+// Copyright 2018 Frédéric Guillot. All rights reserved.
2 2
 // Use of this source code is governed by the MIT license
3 3
 // that can be found in the LICENSE file.
4 4
 
5
-package miniflux
5
+package client // import "miniflux.app/client"
6 6
 
7 7
 import (
8 8
 	"encoding/json"
@@ -13,7 +13,7 @@ import (
13 13
 	"strconv"
14 14
 )
15 15
 
16
-// Client represents a Miniflux client.
16
+// Client holds API procedure calls.
17 17
 type Client struct {
18 18
 	request *request
19 19
 }
@@ -448,8 +448,8 @@ func (c *Client) ToggleBookmark(entryID int64) error {
448 448
 	return nil
449 449
 }
450 450
 
451
-// NewClient returns a new Client.
452
-func NewClient(endpoint, username, password string) *Client {
451
+// New returns a new Miniflux client.
452
+func New(endpoint, username, password string) *Client {
453 453
 	return &Client{request: &request{endpoint: endpoint, username: username, password: password}}
454 454
 }
455 455
 

vendor/github.com/miniflux/miniflux-go/miniflux.go → client/core.go View File

@@ -1,8 +1,8 @@
1
-// Copyright 2017 Frédéric Guillot. All rights reserved.
1
+// Copyright 2018 Frédéric Guillot. All rights reserved.
2 2
 // Use of this source code is governed by the MIT license
3 3
 // that can be found in the LICENSE file.
4 4
 
5
-package miniflux
5
+package client // import "miniflux.app/client"
6 6
 
7 7
 import (
8 8
 	"fmt"

+ 35
- 0
client/doc.go View File

@@ -0,0 +1,35 @@
1
+// Copyright 2018 Frédéric Guillot. All rights reserved.
2
+// Use of this source code is governed by the MIT license
3
+// that can be found in the LICENSE file.
4
+
5
+/*
6
+
7
+Package client implements a client library for the Miniflux REST API.
8
+
9
+Examples
10
+
11
+This code snippet fetch the list of users:
12
+
13
+	import (
14
+		miniflux "miniflux.app/client"
15
+	)
16
+
17
+	client := miniflux.New("https://api.example.org", "admin", "secret")
18
+	users, err := client.Users()
19
+	if err != nil {
20
+		fmt.Println(err)
21
+		return
22
+	}
23
+	fmt.Println(users, err)
24
+
25
+This one discover subscriptions on a website:
26
+
27
+	subscriptions, err := client.Discover("https://example.org/")
28
+	if err != nil {
29
+		fmt.Println(err)
30
+		return
31
+	}
32
+	fmt.Println(subscriptions)
33
+
34
+*/
35
+package client // import "miniflux.app/client"

vendor/github.com/miniflux/miniflux-go/request.go → client/request.go View File

@@ -1,8 +1,8 @@
1
-// Copyright 2017 Frédéric Guillot. All rights reserved.
1
+// Copyright 2018 Frédéric Guillot. All rights reserved.
2 2
 // Use of this source code is governed by the MIT license
3 3
 // that can be found in the LICENSE file.
4 4
 
5
-package miniflux
5
+package client // import "miniflux.app/client"
6 6
 
7 7
 import (
8 8
 	"bytes"

+ 36
- 36
integration_test.go View File

@@ -15,7 +15,7 @@ import (
15 15
 	"testing"
16 16
 	"time"
17 17
 
18
-	"github.com/miniflux/miniflux-go"
18
+	miniflux "miniflux.app/client"
19 19
 )
20 20
 
21 21
 const (
@@ -29,7 +29,7 @@ const (
29 29
 )
30 30
 
31 31
 func TestWithBadEndpoint(t *testing.T) {
32
-	client := miniflux.NewClient("bad url", testAdminUsername, testAdminPassword)
32
+	client := miniflux.New("bad url", testAdminUsername, testAdminPassword)
33 33
 	_, err := client.Users()
34 34
 	if err == nil {
35 35
 		t.Fatal(`Using a bad url should raise an error`)
@@ -37,7 +37,7 @@ func TestWithBadEndpoint(t *testing.T) {
37 37
 }
38 38
 
39 39
 func TestWithWrongCredentials(t *testing.T) {
40
-	client := miniflux.NewClient(testBaseURL, "invalid", "invalid")
40
+	client := miniflux.New(testBaseURL, "invalid", "invalid")
41 41
 	_, err := client.Users()
42 42
 	if err == nil {
43 43
 		t.Fatal(`Using bad credentials should raise an error`)
@@ -49,7 +49,7 @@ func TestWithWrongCredentials(t *testing.T) {
49 49
 }
50 50
 
51 51
 func TestGetCurrentLoggedUser(t *testing.T) {
52
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
52
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
53 53
 	user, err := client.Me()
54 54
 	if err != nil {
55 55
 		t.Fatal(err)
@@ -65,7 +65,7 @@ func TestGetCurrentLoggedUser(t *testing.T) {
65 65
 }
66 66
 
67 67
 func TestGetUsers(t *testing.T) {
68
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
68
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
69 69
 	users, err := client.Users()
70 70
 	if err != nil {
71 71
 		t.Fatal(err)
@@ -106,7 +106,7 @@ func TestGetUsers(t *testing.T) {
106 106
 
107 107
 func TestCreateStandardUser(t *testing.T) {
108 108
 	username := getRandomUsername()
109
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
109
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
110 110
 	user, err := client.CreateUser(username, testStandardPassword, false)
111 111
 	if err != nil {
112 112
 		t.Fatal(err)
@@ -147,7 +147,7 @@ func TestCreateStandardUser(t *testing.T) {
147 147
 
148 148
 func TestRemoveUser(t *testing.T) {
149 149
 	username := getRandomUsername()
150
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
150
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
151 151
 	user, err := client.CreateUser(username, testStandardPassword, false)
152 152
 	if err != nil {
153 153
 		t.Fatal(err)
@@ -160,7 +160,7 @@ func TestRemoveUser(t *testing.T) {
160 160
 
161 161
 func TestGetUserByID(t *testing.T) {
162 162
 	username := getRandomUsername()
163
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
163
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
164 164
 	user, err := client.CreateUser(username, testStandardPassword, false)
165 165
 	if err != nil {
166 166
 		t.Fatal(err)
@@ -211,7 +211,7 @@ func TestGetUserByID(t *testing.T) {
211 211
 
212 212
 func TestGetUserByUsername(t *testing.T) {
213 213
 	username := getRandomUsername()
214
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
214
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
215 215
 	user, err := client.CreateUser(username, testStandardPassword, false)
216 216
 	if err != nil {
217 217
 		t.Fatal(err)
@@ -262,7 +262,7 @@ func TestGetUserByUsername(t *testing.T) {
262 262
 
263 263
 func TestUpdateUserTheme(t *testing.T) {
264 264
 	username := getRandomUsername()
265
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
265
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
266 266
 	user, err := client.CreateUser(username, testStandardPassword, false)
267 267
 	if err != nil {
268 268
 		t.Fatal(err)
@@ -281,7 +281,7 @@ func TestUpdateUserTheme(t *testing.T) {
281 281
 
282 282
 func TestUpdateUserThemeWithInvalidValue(t *testing.T) {
283 283
 	username := getRandomUsername()
284
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
284
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
285 285
 	user, err := client.CreateUser(username, testStandardPassword, false)
286 286
 	if err != nil {
287 287
 		t.Fatal(err)
@@ -296,7 +296,7 @@ func TestUpdateUserThemeWithInvalidValue(t *testing.T) {
296 296
 
297 297
 func TestCannotCreateDuplicateUser(t *testing.T) {
298 298
 	username := getRandomUsername()
299
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
299
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
300 300
 	_, err := client.CreateUser(username, testStandardPassword, false)
301 301
 	if err != nil {
302 302
 		t.Fatal(err)
@@ -310,13 +310,13 @@ func TestCannotCreateDuplicateUser(t *testing.T) {
310 310
 
311 311
 func TestCannotListUsersAsNonAdmin(t *testing.T) {
312 312
 	username := getRandomUsername()
313
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
313
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
314 314
 	_, err := client.CreateUser(username, testStandardPassword, false)
315 315
 	if err != nil {
316 316
 		t.Fatal(err)
317 317
 	}
318 318
 
319
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
319
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
320 320
 	_, err = client.Users()
321 321
 	if err == nil {
322 322
 		t.Fatal(`Standard users should not be able to list any users`)
@@ -329,13 +329,13 @@ func TestCannotListUsersAsNonAdmin(t *testing.T) {
329 329
 
330 330
 func TestCannotGetUserAsNonAdmin(t *testing.T) {
331 331
 	username := getRandomUsername()
332
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
332
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
333 333
 	user, err := client.CreateUser(username, testStandardPassword, false)
334 334
 	if err != nil {
335 335
 		t.Fatal(err)
336 336
 	}
337 337
 
338
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
338
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
339 339
 	_, err = client.UserByID(user.ID)
340 340
 	if err == nil {
341 341
 		t.Fatal(`Standard users should not be able to get any users`)
@@ -348,13 +348,13 @@ func TestCannotGetUserAsNonAdmin(t *testing.T) {
348 348
 
349 349
 func TestCannotUpdateUserAsNonAdmin(t *testing.T) {
350 350
 	username := getRandomUsername()
351
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
351
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
352 352
 	user, err := client.CreateUser(username, testStandardPassword, false)
353 353
 	if err != nil {
354 354
 		t.Fatal(err)
355 355
 	}
356 356
 
357
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
357
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
358 358
 	_, err = client.UpdateUser(user.ID, &miniflux.UserModification{})
359 359
 	if err == nil {
360 360
 		t.Fatal(`Standard users should not be able to update any users`)
@@ -367,13 +367,13 @@ func TestCannotUpdateUserAsNonAdmin(t *testing.T) {
367 367
 
368 368
 func TestCannotCreateUserAsNonAdmin(t *testing.T) {
369 369
 	username := getRandomUsername()
370
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
370
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
371 371
 	_, err := client.CreateUser(username, testStandardPassword, false)
372 372
 	if err != nil {
373 373
 		t.Fatal(err)
374 374
 	}
375 375
 
376
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
376
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
377 377
 	_, err = client.CreateUser(username, testStandardPassword, false)
378 378
 	if err == nil {
379 379
 		t.Fatal(`Standard users should not be able to create users`)
@@ -386,13 +386,13 @@ func TestCannotCreateUserAsNonAdmin(t *testing.T) {
386 386
 
387 387
 func TestCannotDeleteUserAsNonAdmin(t *testing.T) {
388 388
 	username := getRandomUsername()
389
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
389
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
390 390
 	user, err := client.CreateUser(username, testStandardPassword, false)
391 391
 	if err != nil {
392 392
 		t.Fatal(err)
393 393
 	}
394 394
 
395
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
395
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
396 396
 	err = client.DeleteUser(user.ID)
397 397
 	if err == nil {
398 398
 		t.Fatal(`Standard users should not be able to remove any users`)
@@ -405,14 +405,14 @@ func TestCannotDeleteUserAsNonAdmin(t *testing.T) {
405 405
 
406 406
 func TestCreateCategory(t *testing.T) {
407 407
 	username := getRandomUsername()
408
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
408
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
409 409
 	user, err := client.CreateUser(username, testStandardPassword, false)
410 410
 	if err != nil {
411 411
 		t.Fatal(err)
412 412
 	}
413 413
 
414 414
 	categoryName := "My category"
415
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
415
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
416 416
 	category, err := client.CreateCategory(categoryName)
417 417
 	if err != nil {
418 418
 		t.Fatal(err)
@@ -432,7 +432,7 @@ func TestCreateCategory(t *testing.T) {
432 432
 }
433 433
 
434 434
 func TestCreateCategoryWithEmptyTitle(t *testing.T) {
435
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
435
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
436 436
 	_, err := client.CreateCategory("")
437 437
 	if err == nil {
438 438
 		t.Fatal(`The category title should be mandatory`)
@@ -456,14 +456,14 @@ func TestCannotCreateDuplicatedCategory(t *testing.T) {
456 456
 
457 457
 func TestUpdateCategory(t *testing.T) {
458 458
 	username := getRandomUsername()
459
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
459
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
460 460
 	user, err := client.CreateUser(username, testStandardPassword, false)
461 461
 	if err != nil {
462 462
 		t.Fatal(err)
463 463
 	}
464 464
 
465 465
 	categoryName := "My category"
466
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
466
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
467 467
 	category, err := client.CreateCategory(categoryName)
468 468
 	if err != nil {
469 469
 		t.Fatal(err)
@@ -490,14 +490,14 @@ func TestUpdateCategory(t *testing.T) {
490 490
 
491 491
 func TestListCategories(t *testing.T) {
492 492
 	username := getRandomUsername()
493
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
493
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
494 494
 	user, err := client.CreateUser(username, testStandardPassword, false)
495 495
 	if err != nil {
496 496
 		t.Fatal(err)
497 497
 	}
498 498
 
499 499
 	categoryName := "My category"
500
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
500
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
501 501
 	_, err = client.CreateCategory(categoryName)
502 502
 	if err != nil {
503 503
 		t.Fatal(err)
@@ -553,7 +553,7 @@ func TestDeleteCategory(t *testing.T) {
553 553
 
554 554
 func TestCannotDeleteCategoryOfAnotherUser(t *testing.T) {
555 555
 	username := getRandomUsername()
556
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
556
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
557 557
 	categories, err := client.Categories()
558 558
 	if err != nil {
559 559
 		t.Fatal(err)
@@ -564,7 +564,7 @@ func TestCannotDeleteCategoryOfAnotherUser(t *testing.T) {
564 564
 		t.Fatal(err)
565 565
 	}
566 566
 
567
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
567
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
568 568
 	err = client.DeleteCategory(categories[0].ID)
569 569
 	if err == nil {
570 570
 		t.Fatal(`Removing a category that belongs to another user should be forbidden`)
@@ -572,7 +572,7 @@ func TestCannotDeleteCategoryOfAnotherUser(t *testing.T) {
572 572
 }
573 573
 
574 574
 func TestDiscoverSubscriptions(t *testing.T) {
575
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
575
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
576 576
 	subscriptions, err := client.Discover(testWebsiteURL)
577 577
 	if err != nil {
578 578
 		t.Fatal(err)
@@ -956,13 +956,13 @@ func TestGetFeedIcon(t *testing.T) {
956 956
 
957 957
 func TestGetFeedIconNotFound(t *testing.T) {
958 958
 	username := getRandomUsername()
959
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
959
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
960 960
 	_, err := client.CreateUser(username, testStandardPassword, false)
961 961
 	if err != nil {
962 962
 		t.Fatal(err)
963 963
 	}
964 964
 
965
-	client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
965
+	client = miniflux.New(testBaseURL, username, testStandardPassword)
966 966
 	if _, err := client.FeedIcon(42); err == nil {
967 967
 		t.Fatalf(`The feed icon should be null`)
968 968
 	}
@@ -1233,13 +1233,13 @@ func getRandomUsername() string {
1233 1233
 
1234 1234
 func createClient(t *testing.T) *miniflux.Client {
1235 1235
 	username := getRandomUsername()
1236
-	client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
1236
+	client := miniflux.New(testBaseURL, testAdminUsername, testAdminPassword)
1237 1237
 	_, err := client.CreateUser(username, testStandardPassword, false)
1238 1238
 	if err != nil {
1239 1239
 		t.Fatal(err)
1240 1240
 	}
1241 1241
 
1242
-	return miniflux.NewClient(testBaseURL, username, testStandardPassword)
1242
+	return miniflux.New(testBaseURL, username, testStandardPassword)
1243 1243
 }
1244 1244
 
1245 1245
 func createFeed(t *testing.T, client *miniflux.Client) (*miniflux.Feed, *miniflux.Category) {

+ 0
- 9
vendor/github.com/miniflux/miniflux-go/.travis.yml View File

@@ -1,9 +0,0 @@
1
-notifications:
2
-  email: false
3
-language: go
4
-go:
5
-  - 1.9
6
-before_install:
7
-  - go get -u github.com/golang/lint/golint
8
-script:
9
-  - golint *.go

+ 0
- 21
vendor/github.com/miniflux/miniflux-go/LICENSE View File

@@ -1,21 +0,0 @@
1
-The MIT License (MIT)
2
-
3
-Copyright (c) 2017 Frédéric Guillot
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy
6
-of this software and associated documentation files (the "Software"), to deal
7
-in the Software without restriction, including without limitation the rights
8
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
-copies of the Software, and to permit persons to whom the Software is
10
-furnished to do so, subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in
13
-all copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
-THE SOFTWARE.

+ 0
- 65
vendor/github.com/miniflux/miniflux-go/README.md View File

@@ -1,65 +0,0 @@
1
-Go Library for Miniflux
2
-=======================
3
-[![Build Status](https://travis-ci.org/miniflux/miniflux-go.svg?branch=master)](https://travis-ci.org/miniflux/miniflux-go)
4
-[![GoDoc](https://godoc.org/github.com/miniflux/miniflux-go?status.svg)](https://godoc.org/github.com/miniflux/miniflux-go)
5
-
6
-Client library for Miniflux REST API.
7
-
8
-Requirements
9
-------------
10
-
11
-- Miniflux >= 2.0.0
12
-- Go >= 1.9
13
-
14
-Installation
15
-------------
16
-
17
-```bash
18
-go get -u github.com/miniflux/miniflux-go
19
-```
20
-
21
-Example
22
--------
23
-
24
-```go
25
-package main
26
-
27
-import (
28
-	"fmt"
29
-	"io/ioutil"
30
-	"github.com/miniflux/miniflux-go"
31
-)
32
-
33
-func main() {
34
-    client := miniflux.NewClient("https://api.example.org", "admin", "secret")
35
-
36
-    // Fetch all feeds.
37
-    feeds, err := client.Feeds()
38
-    if err != nil {
39
-        fmt.Println(err)
40
-        return
41
-    }
42
-    fmt.Println(feeds)
43
-
44
-    // Backup your feeds to an OPML file.
45
-    opml, err := client.Export()
46
-    if err != nil {
47
-        fmt.Println(err)
48
-        return
49
-    }
50
-
51
-    err = ioutil.WriteFile("opml.xml", opml, 0644)
52
-    if err != nil {
53
-        fmt.Println(err)
54
-        return
55
-    }
56
-
57
-    fmt.Println("backup done!")
58
-}
59
-```
60
-
61
-Credits
62
--------
63
-
64
-- Author: Frédéric Guillot
65
-- Distributed under MIT License

+ 0
- 31
vendor/github.com/miniflux/miniflux-go/doc.go View File

@@ -1,31 +0,0 @@
1
-// Copyright 2017 Frédéric Guillot. All rights reserved.
2
-// Use of this source code is governed by the MIT license
3
-// that can be found in the LICENSE file.
4
-
5
-/*
6
-
7
-Package miniflux implements a client library for the Miniflux REST API.
8
-
9
-Examples
10
-
11
-This code snippet fetch the list of users.
12
-
13
-	client := miniflux.NewClient("https://api.example.org", "admin", "secret")
14
-	users, err := client.Users()
15
-	if err != nil {
16
-		fmt.Println(err)
17
-		return
18
-	}
19
-	fmt.Println(users, err)
20
-
21
-This one discover subscriptions on a website.
22
-
23
-	subscriptions, err := client.Discover("https://example.org/")
24
-	if err != nil {
25
-		fmt.Println(err)
26
-		return
27
-	}
28
-	fmt.Println(subscriptions)
29
-
30
-*/
31
-package miniflux

Loading…
Cancel
Save