Documentation ¶
Index ¶
- type AntidoteAPI
- func (s *AntidoteAPI) CreateLiveLesson(ctx context.Context, ll *pb.LiveLesson) (*empty.Empty, error)
- func (s *AntidoteAPI) GetAllLessonPrereqs(ctx context.Context, lessonSlug *pb.LessonSlug) (*pb.LessonPrereqs, error)
- func (s *AntidoteAPI) GetAntidoteInfo(ctx context.Context, _ *empty.Empty) (*pb.AntidoteInfo, error)
- func (s *AntidoteAPI) GetCollection(ctx context.Context, collectionSlug *pb.CollectionSlug) (*pb.Collection, error)
- func (s *AntidoteAPI) GetCurriculumInfo(ctx context.Context, filter *pb.CurriculumFilter) (*pb.CurriculumInfo, error)
- func (s *AntidoteAPI) GetLesson(ctx context.Context, lessonSlug *pb.LessonSlug) (*pb.Lesson, error)
- func (s *AntidoteAPI) GetLiveLesson(ctx context.Context, llID *pb.LiveLessonId) (*pb.LiveLesson, error)
- func (s *AntidoteAPI) HealthCheck(ctx context.Context, _ *empty.Empty) (*pb.LBHealthCheckResponse, error)
- func (s *AntidoteAPI) KillLiveLesson(ctx context.Context, llID *pb.LiveLessonId) (*pb.KillLiveLessonStatus, error)
- func (s *AntidoteAPI) ListCollections(ctx context.Context, _ *pb.CollectionFilter) (*pb.Collections, error)
- func (s *AntidoteAPI) ListLessons(ctx context.Context, filter *pb.LessonFilter) (*pb.Lessons, error)
- func (s *AntidoteAPI) ListLiveLessons(ctx context.Context, _ *empty.Empty) (*pb.LiveLessons, error)
- func (s *AntidoteAPI) ListLiveSessions(ctx context.Context, _ *empty.Empty) (*pb.LiveSessions, error)
- func (s *AntidoteAPI) RequestLiveLesson(ctx context.Context, lp *pb.LiveLessonRequest) (*pb.LiveLessonId, error)
- func (s *AntidoteAPI) RequestLiveSession(ctx context.Context, _ *empty.Empty) (*pb.LiveSession, error)
- func (apiServer *AntidoteAPI) Start() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AntidoteAPI ¶ added in v0.6.0
type AntidoteAPI struct { Db db.DataManager Config config.AntidoteConfig NC *nats.Conn BuildInfo map[string]string }
AntidoteAPI handles incoming requests from antidote-web, or other gRPC clients
func (*AntidoteAPI) CreateLiveLesson ¶ added in v0.6.0
func (s *AntidoteAPI) CreateLiveLesson(ctx context.Context, ll *pb.LiveLesson) (*empty.Empty, error)
CreateLiveLesson is a HIGHLY non-production function for inserting livelesson state directly for debugging or test purposes. Use this at your own peril.
func (*AntidoteAPI) GetAllLessonPrereqs ¶ added in v0.6.0
func (s *AntidoteAPI) GetAllLessonPrereqs(ctx context.Context, lessonSlug *pb.LessonSlug) (*pb.LessonPrereqs, error)
GetAllLessonPrereqs examines the entire tree of depedencies that a given lesson might have, and returns it as a flattened, de-duplicated list. Used for the advisor's learning path tool in antidote-web
func (*AntidoteAPI) GetAntidoteInfo ¶ added in v0.6.0
func (s *AntidoteAPI) GetAntidoteInfo(ctx context.Context, _ *empty.Empty) (*pb.AntidoteInfo, error)
GetAntidoteInfo provides detailed information about which version of Antidote, and other related software/assets are loaded. Primarily used for a debug banner in the web front-end
func (*AntidoteAPI) GetCollection ¶ added in v0.6.0
func (s *AntidoteAPI) GetCollection(ctx context.Context, collectionSlug *pb.CollectionSlug) (*pb.Collection, error)
GetCollection retrieves a single Collection from the data store by Slug
func (*AntidoteAPI) GetCurriculumInfo ¶ added in v0.6.0
func (s *AntidoteAPI) GetCurriculumInfo(ctx context.Context, filter *pb.CurriculumFilter) (*pb.CurriculumInfo, error)
GetCurriculumInfo is designed to only get high-level information about the loaded Curriculum. Specifics on lessons, collections, and more are given their own first-level API endpoint elsewhere, but will be pulled from the loaded Curriculum struct being described here.
func (*AntidoteAPI) GetLesson ¶ added in v0.6.0
func (s *AntidoteAPI) GetLesson(ctx context.Context, lessonSlug *pb.LessonSlug) (*pb.Lesson, error)
GetLesson retrieves a single Lesson from the data store by Slug
func (*AntidoteAPI) GetLiveLesson ¶ added in v0.6.0
func (s *AntidoteAPI) GetLiveLesson(ctx context.Context, llID *pb.LiveLessonId) (*pb.LiveLesson, error)
GetLiveLesson retrieves a single LiveLesson via ID
func (*AntidoteAPI) HealthCheck ¶ added in v0.6.0
func (s *AntidoteAPI) HealthCheck(ctx context.Context, _ *empty.Empty) (*pb.LBHealthCheckResponse, error)
HealthCheck provides an endpoint for retuning 200K for load balancer health checks
func (*AntidoteAPI) KillLiveLesson ¶ added in v0.6.0
func (s *AntidoteAPI) KillLiveLesson(ctx context.Context, llID *pb.LiveLessonId) (*pb.KillLiveLessonStatus, error)
KillLiveLesson allows a client to request that a livelesson is killed, meaning the underlying resources (like kubernetes namespace) are deleted, and local state is cleaned up appropriately
func (*AntidoteAPI) ListCollections ¶ added in v0.6.0
func (s *AntidoteAPI) ListCollections(ctx context.Context, _ *pb.CollectionFilter) (*pb.Collections, error)
ListCollections returns a list of Collections present in the data store
func (*AntidoteAPI) ListLessons ¶ added in v0.6.0
func (s *AntidoteAPI) ListLessons(ctx context.Context, filter *pb.LessonFilter) (*pb.Lessons, error)
ListLessons returns a list of Lessons present in the data store
func (*AntidoteAPI) ListLiveLessons ¶ added in v0.6.0
func (s *AntidoteAPI) ListLiveLessons(ctx context.Context, _ *empty.Empty) (*pb.LiveLessons, error)
ListLiveLessons returns a list of LiveLessons present in the data store
func (*AntidoteAPI) ListLiveSessions ¶ added in v0.6.0
func (s *AntidoteAPI) ListLiveSessions(ctx context.Context, _ *empty.Empty) (*pb.LiveSessions, error)
ListLiveSessions lists the currently available livesessions within the backing data store
func (*AntidoteAPI) RequestLiveLesson ¶ added in v0.6.0
func (s *AntidoteAPI) RequestLiveLesson(ctx context.Context, lp *pb.LiveLessonRequest) (*pb.LiveLessonId, error)
RequestLiveLesson allows the client to get a handle on a livelesson when they only know their session ID and the desired lesson slug and stage ID. This is typically the first call on antidote-web's lab interface, since these pieces of information are typically known, but a specific livelesson ID is not. There are three main reasons why you would want to call this endpoint:
- Request that a livelesson is created, such as when you initially load a lesson - Modify an existing livelesson - such as moving to a different stage ID - Refreshing the lastUsed timestamp on the livelesson, which lets the back-end know it's still in use.
func (*AntidoteAPI) RequestLiveSession ¶ added in v0.6.0
func (s *AntidoteAPI) RequestLiveSession(ctx context.Context, _ *empty.Empty) (*pb.LiveSession, error)
RequestLiveSession generates a new session ID, performs basic security functions, installs the new session in state management, and returns the ID to the client
func (*AntidoteAPI) Start ¶ added in v0.6.0
func (apiServer *AntidoteAPI) Start() error
Start runs the API server. Meant to be executed in a goroutine, as it will block indefinitely