docker_hub_api 1.0.9

  • Readme
  • Changelog
  • Example
  • Installing
  • new62

DockerHub API #

The Docker Registry HTTP API is the protocol to facilitate distribution of images to the docker engine.

It interacts with instances of the docker registry, which is a service to manage information about docker images and enable their distribution.

Usage #

import 'package:docker_hub_api/docker_hub_api.dart';

void main() async {
  var repo = DockerRepository('nginx');

  var images = await repo.images(page: 1);

  var image = images.first;

  print(image.user);
  print(image.name);
  print(image.namespace);
  print(image.repository_type);
  print(image.status);
  print(image.description);
  print(image.is_private);
  print(image.is_automated);
  print(image.can_edit);
  print(image.star_count);
  print(image.pull_count);
  print(image.last_updated);
  print(image.is_migrated);
  print(image.has_starred);
  print(image.full_description);
  print(image.affiliation);
  print(repo.imageCount);
  print(repo.pageCount);
}

Changelog #

1.0.9 #

  • Update Image

1.0.8 #

  • Docker Image to Json

1.0.7 #

  • Fixes

1.0.6 #

  • Fixes

1.0.5 #

  • Get Image

1.0.4 #

  • Fixes Pagination

1.0.3 #

  • Fixes

1.0.2 #

  • Dart Analyzer

1.0.1 #

  • Docker Hub

1.0.0 #

  • Initial version

example/example.dart

import 'package:docker_hub_api/docker_hub_api.dart';

void main() async {
  var repo = DockerRepository('luizeof');

  // var images = await repo.images(page: 1);

  var image = await repo.getImage("nginx-proxy");

  print(image.user);
  print(image.name);
  print(image.namespace);
  print(image.repository_type);
  print(image.status);
  print(image.description);
  print(image.is_private);
  print(image.is_automated);
  print(image.can_edit);
  print(image.star_count);
  print(image.pull_count);
  print(image.last_updated);
  print(image.is_migrated);
  print(image.has_starred);
  print(image.full_description);
  print(image.affiliation);
  print(image.imageKey);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  docker_hub_api: ^1.0.9

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:docker_hub_api/docker_hub_api.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/docker_hub_repository.dart. (-0.50 points)

Analysis of lib/src/docker_hub_repository.dart reported 1 hint:

line 86 col 14: Unnecessary new keyword.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
http ^0.12.0+4 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6