// GetByID according to the ID for the client information
GetByID according to the ID for the client information
// GetByID according to the ID for the client information
func (cs *MongoClientStore) GetByID(id string) (cli oauth2.ClientInfo, err error) {
	if cli = getClientCache(id); cli != nil {
		return
	}
	c := cs.client.Database(cs.db).Collection(cs.collection)
	query := c.FindOne(context.TODO(), bson.M{"_id": id})
	client := &Oauth2Client{}
	err = query.Decode(client)
	if err != nil {
		return nil, err
	}
	addClientCache(client)
	return client, nil
}
func ( cs * MongoClientStore ) GetByID ( id string ) ( cli oauth2 . ClientInfo , err error ) { if cli = getClientCache ( id ) ; cli != nil { return } c := cs . client . Database ( cs . db ) . Collection ( cs . collection ) query := c . FindOne ( context . TODO ( ) , bson . M { " " : id } ) client := & Oauth2Client { } err = query . Decode ( client ) if err != nil { return nil , err } addClientCache ( client ) return client , nil }
GetByID according to the ID for the client information
GetByID according to the ID for the client information