mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 21:32:24 -06:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			639 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			639 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package message
 | 
						|
 | 
						|
import (
 | 
						|
	"fmt"
 | 
						|
 | 
						|
	apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
 | 
						|
	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
 | 
						|
)
 | 
						|
 | 
						|
func (p *processor) InstanceGet(domain string) (*apimodel.Instance, ErrorWithCode) {
 | 
						|
	i := >smodel.Instance{}
 | 
						|
	if err := p.db.GetWhere("domain", domain, i); err != nil {
 | 
						|
		return nil, NewErrorInternalError(fmt.Errorf("db error fetching instance %s: %s", p.config.Host, err))
 | 
						|
	}
 | 
						|
 | 
						|
	ai, err := p.tc.InstanceToMasto(i)
 | 
						|
	if err != nil {
 | 
						|
		return nil, NewErrorInternalError(fmt.Errorf("error converting instance to api representation: %s", err))
 | 
						|
	}
 | 
						|
 | 
						|
	return ai, nil
 | 
						|
}
 |