42 lines
1015 B
Java
42 lines
1015 B
Java
package tk.antoine_roux.wiki;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Class use to perist registered gitlab runner
|
|
*/
|
|
@Service
|
|
public class RunnerRegistrar {
|
|
private final List<Runner> runners = new ArrayList<>();
|
|
|
|
public List<Runner> getRunners() {
|
|
return this.runners;
|
|
}
|
|
|
|
public void addRunner(Runner r) {
|
|
this.runners.add(r);
|
|
}
|
|
|
|
/**
|
|
* in memory representation of gitlab runner
|
|
*/
|
|
public static class Runner {
|
|
private static final String TAG_SEPARATOR = ",";
|
|
|
|
public String id;
|
|
public String description;
|
|
public String[] tags;
|
|
public String registrationToken;
|
|
|
|
public Runner(String id, String description, String tags, String registrationToken) {
|
|
this.id = id;
|
|
this.description = description;
|
|
this.tags = tags.split(TAG_SEPARATOR);
|
|
this.registrationToken = registrationToken;
|
|
}
|
|
}
|
|
}
|