Documentation ¶
Index ¶
- func MakeDataServer() (*handler.H, chan struct{}, error)
- type DataServer
- func (ds *DataServer) AddCapability(ctx context.Context, cr *data.CapabilityRequest) (*empty.Empty, error)
- func (ds *DataServer) AddError(ctx context.Context, ue *types.UserError) (*empty.Empty, error)
- func (ds *DataServer) AddSubscription(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
- func (ds *DataServer) AllRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
- func (ds *DataServer) CancelRefByName(ctx context.Context, rr *data.RepoRef) (*empty.Empty, error)
- func (ds *DataServer) CancelSubmission(ctx context.Context, id *types.IntID) (*empty.Empty, error)
- func (ds *DataServer) CancelTask(ctx context.Context, id *types.IntID) (*empty.Empty, error)
- func (ds *DataServer) CancelTasksByPR(ctx context.Context, prq *types.CancelPRRequest) (*empty.Empty, error)
- func (ds *DataServer) CountRunsForTask(ctx context.Context, id *types.IntID) (*data.Count, error)
- func (ds *DataServer) CountSubmissions(ctx context.Context, req *data.RepositoryFilterRequest) (*data.Count, error)
- func (ds *DataServer) CountTasks(ctx context.Context, req *data.TaskListRequest) (*data.Count, error)
- func (ds *DataServer) DeleteError(ctx context.Context, ue *types.UserError) (*empty.Empty, error)
- func (ds *DataServer) DeleteToken(ctx context.Context, name *data.Name) (*empty.Empty, error)
- func (ds *DataServer) DisableRepository(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
- func (ds *DataServer) EnableRepository(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
- func (ds *DataServer) GetCancel(ctx context.Context, id *types.IntID) (*types.Status, error)
- func (ds *DataServer) GetCapabilities(ctx context.Context, u *types.User) (*data.Capabilities, error)
- func (ds *DataServer) GetErrors(ctx context.Context, name *data.Name) (*types.UserErrors, error)
- func (ds *DataServer) GetRefByNameAndSHA(ctx context.Context, rp *data.RefPair) (*types.Ref, error)
- func (ds *DataServer) GetRepository(ctx context.Context, name *data.Name) (*types.Repository, error)
- func (ds *DataServer) GetRun(ctx context.Context, id *types.IntID) (*types.Run, error)
- func (ds *DataServer) GetRunUI(ctx context.Context, id *types.IntID) (*types.Run, error)
- func (ds *DataServer) GetSubmission(ctx context.Context, id *types.IntID) (*types.Submission, error)
- func (ds *DataServer) GetSubmissionRuns(ctx context.Context, sub *data.SubmissionQuery) (*types.RunList, error)
- func (ds *DataServer) GetSubmissionTasks(ctx context.Context, sub *data.SubmissionQuery) (*types.TaskList, error)
- func (ds *DataServer) GetToken(ctx context.Context, name *data.Name) (*types.StringID, error)
- func (ds *DataServer) HasCapability(ctx context.Context, cr *data.CapabilityRequest) (*types.Bool, error)
- func (ds *DataServer) ListSubmissions(ctx context.Context, req *data.RepositoryFilterRequestWithPagination) (*types.SubmissionList, error)
- func (ds *DataServer) ListSubscribedTasksForUser(ctx context.Context, lstr *data.ListSubscribedTasksRequest) (*types.TaskList, error)
- func (ds *DataServer) ListSubscriptions(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
- func (ds *DataServer) ListTasks(ctx context.Context, req *data.TaskListRequest) (*types.TaskList, error)
- func (ds *DataServer) ListUsers(ctx context.Context, e *empty.Empty) (*types.UserList, error)
- func (ds *DataServer) LoadSession(ctx context.Context, id *types.StringID) (*types.Session, error)
- func (ds *DataServer) OAuthRegisterState(ctx context.Context, oas *data.OAuthState) (*empty.Empty, error)
- func (ds *DataServer) OAuthValidateState(ctx context.Context, oas *data.OAuthState) (*data.OAuthState, error)
- func (ds *DataServer) OwnedRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
- func (ds *DataServer) PatchUser(ctx context.Context, u *types.User) (*empty.Empty, error)
- func (ds *DataServer) PrivateRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
- func (ds *DataServer) PublicRepositories(ctx context.Context, search *data.Search) (*types.RepositoryList, error)
- func (ds *DataServer) PutRef(ctx context.Context, ref *types.Ref) (*types.Ref, error)
- func (ds *DataServer) PutSession(ctx context.Context, s *types.Session) (*empty.Empty, error)
- func (ds *DataServer) PutStatus(ctx context.Context, s *types.Status) (*empty.Empty, error)
- func (ds *DataServer) PutSubmission(ctx context.Context, sub *types.Submission) (*types.Submission, error)
- func (ds *DataServer) PutTask(ctx context.Context, task *types.Task) (*types.Task, error)
- func (ds *DataServer) PutUser(ctx context.Context, u *types.User) (*types.User, error)
- func (ds *DataServer) QueueAdd(ctx context.Context, list *data.QueueList) (*data.QueueList, error)
- func (ds *DataServer) QueueCount(ctx context.Context, empty *empty.Empty) (*data.Count, error)
- func (ds *DataServer) QueueCountForRepository(ctx context.Context, repo *data.Name) (*data.Count, error)
- func (ds *DataServer) QueueListForRepository(ctx context.Context, qlr *data.QueueListRequest) (*data.QueueList, error)
- func (ds *DataServer) QueueNext(ctx context.Context, r *types.QueueRequest) (*types.QueueItem, error)
- func (ds *DataServer) RemoveCapability(ctx context.Context, cr *data.CapabilityRequest) (*empty.Empty, error)
- func (ds *DataServer) RemoveSubscription(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
- func (ds *DataServer) RunCount(ctx context.Context, rp *data.RefPair) (*data.Count, error)
- func (ds *DataServer) RunList(ctx context.Context, rq *data.RunListRequest) (*types.RunList, error)
- func (ds *DataServer) RunsForTask(ctx context.Context, req *data.RunsForTaskRequest) (*types.RunList, error)
- func (ds *DataServer) SaveRepositories(ctx context.Context, gh *data.GithubJSON) (*empty.Empty, error)
- func (ds *DataServer) SetCancel(ctx context.Context, id *types.IntID) (*empty.Empty, error)
- func (ds *DataServer) UserByName(ctx context.Context, name *data.Name) (*types.User, error)
- func (ds *DataServer) ValidateToken(ctx context.Context, id *types.StringID) (*types.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDataServer ¶
MakeDataServer makes an instance of the datasvc on port 6000. It returns a chan which can be closed to terminate it, and any boot-time errors.
Types ¶
type DataServer ¶
DataServer is the handle into the GRPC subsystem for the datasvc.
func (*DataServer) AddCapability ¶
func (ds *DataServer) AddCapability(ctx context.Context, cr *data.CapabilityRequest) (*empty.Empty, error)
AddCapability adds a capability for a user.
func (*DataServer) AddSubscription ¶
func (ds *DataServer) AddSubscription(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
AddSubscription subscribes a repository to a user's account.
func (*DataServer) AllRepositories ¶
func (ds *DataServer) AllRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
AllRepositories returns the list of repositories the user can see.
func (*DataServer) CancelRefByName ¶
CancelRefByName cancels by the ref for all runs related to it. It is looked up by ref and repository information. It is used by the queuesvc to auto cancel runs as new ones are being submitted.
func (*DataServer) CancelSubmission ¶
CancelSubmission cancels a submission by ID.
func (*DataServer) CancelTask ¶
CancelTask cancels a task by ID.
func (*DataServer) CancelTasksByPR ¶
func (ds *DataServer) CancelTasksByPR(ctx context.Context, prq *types.CancelPRRequest) (*empty.Empty, error)
CancelTasksByPR cancels multiple tasks by Pull Request ID.
func (*DataServer) CountRunsForTask ¶
CountRunsForTask counts all the runs for a given task.
func (*DataServer) CountSubmissions ¶
func (ds *DataServer) CountSubmissions(ctx context.Context, req *data.RepositoryFilterRequest) (*data.Count, error)
CountSubmissions returns a count of all submissions that match the filter.
func (*DataServer) CountTasks ¶
func (ds *DataServer) CountTasks(ctx context.Context, req *data.TaskListRequest) (*data.Count, error)
CountTasks counts the number of tasks that would be found by the query
func (*DataServer) DeleteError ¶
DeleteError removes an error from errors list. The error string does not need to be provided.
func (*DataServer) DeleteToken ¶
DeleteToken removes the existing token; a new GetToken request will generate a new one.
func (*DataServer) DisableRepository ¶
func (ds *DataServer) DisableRepository(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
DisableRepository removes the repository from the CI system. It must already be enabled.
func (*DataServer) EnableRepository ¶
func (ds *DataServer) EnableRepository(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
EnableRepository adds the repository to the CI system. It must already exist.
func (*DataServer) GetCapabilities ¶
func (ds *DataServer) GetCapabilities(ctx context.Context, u *types.User) (*data.Capabilities, error)
GetCapabilities retrieves the capabilities for a user.
func (*DataServer) GetErrors ¶
func (ds *DataServer) GetErrors(ctx context.Context, name *data.Name) (*types.UserErrors, error)
GetErrors retrieves the errors for the provided user.
func (*DataServer) GetRefByNameAndSHA ¶
GetRefByNameAndSHA retrieves the ref from repository and sha data.
func (*DataServer) GetRepository ¶
func (ds *DataServer) GetRepository(ctx context.Context, name *data.Name) (*types.Repository, error)
GetRepository returns the repository information for the provided name.
func (*DataServer) GetSubmission ¶
func (ds *DataServer) GetSubmission(ctx context.Context, id *types.IntID) (*types.Submission, error)
GetSubmission returns a submission from the provided ID
func (*DataServer) GetSubmissionRuns ¶
func (ds *DataServer) GetSubmissionRuns(ctx context.Context, sub *data.SubmissionQuery) (*types.RunList, error)
GetSubmissionRuns returns the runs associated with the provided submission.
func (*DataServer) GetSubmissionTasks ¶
func (ds *DataServer) GetSubmissionTasks(ctx context.Context, sub *data.SubmissionQuery) (*types.TaskList, error)
GetSubmissionTasks returns the tasks associated with the provided submission.
func (*DataServer) GetToken ¶
GetToken retrieves a token, creating it if necessary, for the user supplied. This token can be presented by the user as a part of the authentication process to login to tinyci and perform operations.
If the token is already set, then this function will return an error and refuse to yield the existing token.
func (*DataServer) HasCapability ¶
func (ds *DataServer) HasCapability(ctx context.Context, cr *data.CapabilityRequest) (*types.Bool, error)
HasCapability returns true if the capability requested exists for the user provided.
func (*DataServer) ListSubmissions ¶
func (ds *DataServer) ListSubmissions(ctx context.Context, req *data.RepositoryFilterRequestWithPagination) (*types.SubmissionList, error)
ListSubmissions lists the submissions with optional repository and ref filtering.
func (*DataServer) ListSubscribedTasksForUser ¶
func (ds *DataServer) ListSubscribedTasksForUser(ctx context.Context, lstr *data.ListSubscribedTasksRequest) (*types.TaskList, error)
ListSubscribedTasksForUser mirrors the model call by the same name.
func (*DataServer) ListSubscriptions ¶
func (ds *DataServer) ListSubscriptions(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
ListSubscriptions lists all subscriptions for a user
func (*DataServer) ListTasks ¶
func (ds *DataServer) ListTasks(ctx context.Context, req *data.TaskListRequest) (*types.TaskList, error)
ListTasks returns a list of tasks based on the query.
func (*DataServer) LoadSession ¶
LoadSession retrieves a session by ID.
func (*DataServer) OAuthRegisterState ¶
func (ds *DataServer) OAuthRegisterState(ctx context.Context, oas *data.OAuthState) (*empty.Empty, error)
OAuthRegisterState registers the state code with the datasvc; it will be used to validate the other side of the handshake when github redirects back to us.
func (*DataServer) OAuthValidateState ¶
func (ds *DataServer) OAuthValidateState(ctx context.Context, oas *data.OAuthState) (*data.OAuthState, error)
OAuthValidateState registers the state code with the datasvc; it will be used to validate the other side of the handshake when github redirects back to us.
func (*DataServer) OwnedRepositories ¶
func (ds *DataServer) OwnedRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
OwnedRepositories returns the list of owned repositories by the user
func (*DataServer) PatchUser ¶
PatchUser loads a user record, overlays the changes and pushes it back to the db.
func (*DataServer) PrivateRepositories ¶
func (ds *DataServer) PrivateRepositories(ctx context.Context, nameSearch *data.NameSearch) (*types.RepositoryList, error)
PrivateRepositories returns the list of private repositories the user can see.
func (*DataServer) PublicRepositories ¶
func (ds *DataServer) PublicRepositories(ctx context.Context, search *data.Search) (*types.RepositoryList, error)
PublicRepositories returns the list of repositories the user can see.
func (*DataServer) PutSession ¶
PutSession saves a session created for a user.
func (*DataServer) PutSubmission ¶
func (ds *DataServer) PutSubmission(ctx context.Context, sub *types.Submission) (*types.Submission, error)
PutSubmission registers a submission with the datasvc.
func (*DataServer) PutTask ¶
PutTask creates a new task for use. Returns the ID of the created task.
func (*DataServer) QueueCount ¶
QueueCount is the count of items in the queue
func (*DataServer) QueueCountForRepository ¶
func (ds *DataServer) QueueCountForRepository(ctx context.Context, repo *data.Name) (*data.Count, error)
QueueCountForRepository is the count of items in the queue for the given repository
func (*DataServer) QueueListForRepository ¶
func (ds *DataServer) QueueListForRepository(ctx context.Context, qlr *data.QueueListRequest) (*data.QueueList, error)
QueueListForRepository lists the queue with pagination
func (*DataServer) QueueNext ¶
func (ds *DataServer) QueueNext(ctx context.Context, r *types.QueueRequest) (*types.QueueItem, error)
QueueNext returns the next item for the named queue.
func (*DataServer) RemoveCapability ¶
func (ds *DataServer) RemoveCapability(ctx context.Context, cr *data.CapabilityRequest) (*empty.Empty, error)
RemoveCapability removes a capability from a user.
func (*DataServer) RemoveSubscription ¶
func (ds *DataServer) RemoveSubscription(ctx context.Context, rus *data.RepoUserSelection) (*empty.Empty, error)
RemoveSubscription removes a subscription from the user's subscriptions.
func (*DataServer) RunList ¶
func (ds *DataServer) RunList(ctx context.Context, rq *data.RunListRequest) (*types.RunList, error)
RunList lists the runs with pagination
func (*DataServer) RunsForTask ¶
func (ds *DataServer) RunsForTask(ctx context.Context, req *data.RunsForTaskRequest) (*types.RunList, error)
RunsForTask retrieves all the runs for the task, with optional pagination.
func (*DataServer) SaveRepositories ¶
func (ds *DataServer) SaveRepositories(ctx context.Context, gh *data.GithubJSON) (*empty.Empty, error)
SaveRepositories saves the provided user's repositories with the username as the owner.
func (*DataServer) SetCancel ¶
SetCancel flags the run (which will flag the rest of the task's runs) as canceled. Will fail on finished tasks.
func (*DataServer) UserByName ¶
UserByName retrieves the user by name and returns it.
func (*DataServer) ValidateToken ¶
ValidateToken accepts the token and returns an error if the user cannot login.