Documentation ¶
Index ¶
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- type AuthResponse
- type Elemental
- func (e *Elemental) AddFound(_ context.Context, req *pb.SuggestionRequest) (*emptypb.Empty, error)
- func (e *Elemental) CreateSugg(_ context.Context, req *pb.CreateRequest) (*emptypb.Empty, error)
- func (e *Elemental) CreateSuggestion(mark string, pioneer string, elem1 string, elem2 string, id string) (bool, string)
- func (e *Elemental) CreateUser(name string, password string) AuthResponse
- func (e *Elemental) DownSuggestion(_ context.Context, req *pb.SuggestionRequest) (*pb.VoteResponse, error)
- func (e *Elemental) DownvoteSuggestion(id, uid string) (bool, string)
- func (e *Elemental) GetAll(uid *wrapperspb.StringValue, stream pb.Elemental_GetAllServer) error
- func (e *Elemental) GetCombination(_ context.Context, inp *pb.Combination) (*pb.CombinationResult, error)
- func (e *Elemental) GetCombo(elem1, elem2 string) (string, bool, error)
- func (e *Elemental) GetElem(_ context.Context, inp *wrapperspb.StringValue) (*pb.Element, error)
- func (e *Elemental) GetElement(elemName string) (*pb.Element, error)
- func (e *Elemental) GetFound(uid string) ([]string, error)
- func (e *Elemental) GetInv(_ context.Context, uid *wrapperspb.StringValue) (*pb.Inventory, error)
- func (e *Elemental) GetRec(_ context.Context, _ *emptypb.Empty) (*pb.Recents, error)
- func (e *Elemental) GetRecents() ([]*pb.RecentCombination, error)
- func (e *Elemental) GetSuggestion(_ context.Context, id *wrapperspb.StringValue) (*pb.Suggestion, error)
- func (e *Elemental) GetSuggestionCombos(_ context.Context, req *pb.Combination) (*pb.SuggestionCombinationResponse, error)
- func (e *Elemental) GetSuggestions(elem1 string, elem2 string) ([]string, error)
- func (e *Elemental) LoginUser(name string, password string) AuthResponse
- func (e *Elemental) NewAnonymousUser() AuthResponse
- func (e *Elemental) NewFound(elem string, uid string) error
- func (e *Elemental) NewRecent(recent *pb.RecentCombination) error
- func (e *Elemental) NewSugg(_ context.Context, req *pb.NewSuggestionRequest) (*pb.VoteResponse, error)
- func (e *Elemental) NewSuggestion(elem1, elem2 string, suggestion *pb.Suggestion) (bool, error)
- func (e *Elemental) RandomLonely(_ context.Context, req *wrapperspb.StringValue) (*pb.RandomCombinationResponse, error)
- func (e *Elemental) RandomLonelySuggestion(uid string) ([]string, error)
- func (e *Elemental) RefreshElement(elemName string) (*pb.Element, error)
- func (e *Elemental) UpAndComing(_ context.Context, req *wrapperspb.StringValue) (*pb.RandomCombinationResponse, error)
- func (e *Elemental) UpAndComingSuggestion(uid string) ([]string, error)
- func (e *Elemental) UpSuggestion(_ context.Context, req *pb.SuggestionRequest) (*pb.VoteResponse, error)
- func (e *Elemental) UpvoteSuggestion(id, uid string) (bool, bool, string)
- func (e *Elemental) WaitForNextRecent(_ *emptypb.Empty, stream pb.Elemental_WaitForNextRecentServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomStringURLSafe ¶
GenerateRandomStringURLSafe returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
Types ¶
type AuthResponse ¶
AuthResponse is the response to CreateUser, LoginUser, and NewAnonymous
type Elemental ¶
type Elemental struct { *pb.UnimplementedElementalServer // contains filtered or unexported fields }
Elemental is the default server at https://elem7.tk
func InitElemental ¶
InitElemental initializes all of Elemental's handlers on the app.
func (*Elemental) CreateSugg ¶
func (*Elemental) CreateSuggestion ¶
func (e *Elemental) CreateSuggestion(mark string, pioneer string, elem1 string, elem2 string, id string) (bool, string)
CreateSuggestion creates a suggestion
func (*Elemental) CreateUser ¶
func (e *Elemental) CreateUser(name string, password string) AuthResponse
CreateUser creates a user
func (*Elemental) DownSuggestion ¶
func (e *Elemental) DownSuggestion(_ context.Context, req *pb.SuggestionRequest) (*pb.VoteResponse, error)
func (*Elemental) DownvoteSuggestion ¶
DownvoteSuggestion downvotes a suggestion
func (*Elemental) GetAll ¶
func (e *Elemental) GetAll(uid *wrapperspb.StringValue, stream pb.Elemental_GetAllServer) error
func (*Elemental) GetCombination ¶
func (e *Elemental) GetCombination(_ context.Context, inp *pb.Combination) (*pb.CombinationResult, error)
func (*Elemental) GetElem ¶
func (e *Elemental) GetElem(_ context.Context, inp *wrapperspb.StringValue) (*pb.Element, error)
func (*Elemental) GetElement ¶
GetElement gets an element from the database
func (*Elemental) GetInv ¶
func (e *Elemental) GetInv(_ context.Context, uid *wrapperspb.StringValue) (*pb.Inventory, error)
func (*Elemental) GetRecents ¶
func (e *Elemental) GetRecents() ([]*pb.RecentCombination, error)
func (*Elemental) GetSuggestion ¶
func (e *Elemental) GetSuggestion(_ context.Context, id *wrapperspb.StringValue) (*pb.Suggestion, error)
func (*Elemental) GetSuggestionCombos ¶
func (e *Elemental) GetSuggestionCombos(_ context.Context, req *pb.Combination) (*pb.SuggestionCombinationResponse, error)
func (*Elemental) GetSuggestions ¶
GetSuggestions gets all of the suggestions for a given combo
func (*Elemental) LoginUser ¶
func (e *Elemental) LoginUser(name string, password string) AuthResponse
func (*Elemental) NewAnonymousUser ¶
func (e *Elemental) NewAnonymousUser() AuthResponse
func (*Elemental) NewSugg ¶
func (e *Elemental) NewSugg(_ context.Context, req *pb.NewSuggestionRequest) (*pb.VoteResponse, error)
func (*Elemental) NewSuggestion ¶
NewSuggestion makes a new suggestion
func (*Elemental) RandomLonely ¶
func (e *Elemental) RandomLonely(_ context.Context, req *wrapperspb.StringValue) (*pb.RandomCombinationResponse, error)
func (*Elemental) RandomLonelySuggestion ¶
RandomLonelySuggestion gets a random lonely suggestion
func (*Elemental) RefreshElement ¶
RefreshElement gets an element from the database and refreshes the local cache with that element
func (*Elemental) UpAndComing ¶
func (e *Elemental) UpAndComing(_ context.Context, req *wrapperspb.StringValue) (*pb.RandomCombinationResponse, error)
Pretty much the same, just different first line
func (*Elemental) UpAndComingSuggestion ¶
UpAndComingSuggestion suggestion gets a suggestion that needs one vote
func (*Elemental) UpSuggestion ¶
func (e *Elemental) UpSuggestion(_ context.Context, req *pb.SuggestionRequest) (*pb.VoteResponse, error)
func (*Elemental) UpvoteSuggestion ¶
UpvoteSuggestion upvotes a suggestion